Skip to content

Commit

Permalink
update stat_ids
Browse files Browse the repository at this point in the history
the previous code unintentionally dropped some ids
  • Loading branch information
mrcaseb committed Jul 2, 2024
1 parent d4c5c43 commit d89f2f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions data-raw/build_stat_id_df.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
library(magrittr)

stat_ids <- "http://www.nflgsis.com/gsis/Documentation/Partners/StatIDs_files/sheet001.html" %>%
xml2::read_html() %>%
rvest::html_table(fill = TRUE) %>%
as.data.frame() %>%
dplyr::rename("stat_id" = X1, "name" = X2, "comment" = X3) %>%
dplyr::select(1:3) %>%
dplyr::slice(-1) %>%
dplyr::na_if("") %>%
dplyr::filter(!is.na(comment)) %>%
dplyr::mutate(stat_id = as.integer(stat_id)) %>%
dplyr::group_by(stat_id, name) %>%
dplyr::summarise(comment = paste0(comment, collapse = " ")) %>%
dplyr::ungroup() %>%
stat_ids <- "https://www.nflgsis.com/gsis/Documentation/Partners/StatIDs_files/sheet001.html" |>
xml2::read_html() |>
rvest::html_table(fill = TRUE) |>
as.data.frame() |>
dplyr::rename("stat_id" = X1, "name" = X2, "comment" = X3) |>
dplyr::select(1:3) |>
dplyr::slice(-1) |>
dplyr::mutate(stat_id = as.integer(stat_id)) |>
dplyr::filter(!is.na(stat_id)) |>
dplyr::group_by(stat_id, name) |>
dplyr::summarise(comment = paste0(comment, collapse = " ")) |>
dplyr::ungroup() |>
dplyr::mutate(comment = stringr::str_squish(comment))

# save(stat_ids, file = "data-raw/stat_ids.rda")
usethis::use_data(stat_ids, overwrite = TRUE)
Binary file modified data/stat_ids.rda
Binary file not shown.

0 comments on commit d89f2f8

Please sign in to comment.