Skip to content

Commit

Permalink
Update wordmarks (#140)
Browse files Browse the repository at this point in the history
* get cleaned wordmarks from the data repo

* Increase version and add script for cleaned wordmarks
  • Loading branch information
mrcaseb authored Nov 18, 2020
1 parent 5092bdc commit 341cc3d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: nflfastR
Title: Functions to Efficiently Access NFL Play by Play Data
Version: 3.1.1.9003
Version: 3.1.1.9004
Authors@R:
c(person(given = "Sebastian",
family = "Carl",
Expand Down
23 changes: 23 additions & 0 deletions data-raw/wordmarks.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library(dplyr)

teams <- nflfastR::teams_colors_logos %>%
dplyr::filter(!team_abbr %in% c("LAR", "OAK", "SD", "STL"))

purrr::walk(teams$team_abbr, function(x){

image <- magick::image_trim(magick::image_read(glue::glue(
"https://static.www.nfl.com/league/apps/clubs/wordmarks/{x}_fullcolor.png"
)))

magick::image_write(image, path = glue::glue("wordmarks/{x}.png"), format = "png")

if(x == "LA") {
magick::image_write(image, path = "wordmarks/LAR.png", format = "png")
magick::image_write(image, path = "wordmarks/STL.png", format = "png")
} else if(x == "LAC"){
magick::image_write(image, path = "wordmarks/SD.png", format = "png")
} else if(x == "LV"){
magick::image_write(image, path = "wordmarks/OAK.png", format = "png")
}

})
Binary file modified data/teams_colors_logos.rda
Binary file not shown.

0 comments on commit 341cc3d

Please sign in to comment.