Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve inconsistent datatype due to csv usage #326

Merged
merged 1 commit into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 4.3.0.9011
Version: 4.3.0.9012
Authors@R:
c(person(given = "Sebastian",
family = "Carl",
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
5 changes: 4 additions & 1 deletion data-raw/default_play.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ sk <- pbp_db |>

readr::write_csv(sk, "data-raw/pbp_datatypes.csv")

sk <- readr::read_csv("data-raw/pbp_datatypes.csv")

random_play <- pbp_db |>
dplyr::filter(season == 2021) |>
dplyr::filter(season == 1999) |>
dplyr::collect() |>
dplyr::slice_sample(n = 1) |>
as.list()
Expand Down Expand Up @@ -47,3 +49,4 @@ default_play <-
dplyr::mutate(game_id = "9999_99_DEF_TYP")

readr::write_csv(default_play, "data-raw/pbp_defaultplay.csv")
saveRDS(default_play, "data-raw/pbp_defaultplay.rds")
2 changes: 0 additions & 2 deletions data-raw/pbp_defaultplay.csv

This file was deleted.

Binary file added data-raw/pbp_defaultplay.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion data-raw/tidy_play_stats_row.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tidy_play_stats_row <-

tidy_play_stats_row <- nflfastR:::tidy_play_stats_row
scramble_fix <- readRDS("data-raw/scramble_fix.rds")
default_play <- readr::read_csv("data-raw/pbp_defaultplay.csv")
default_play <- readRDS("data-raw/pbp_defaultplay.rds")
usethis::use_data(
tidy_play_stats_row, scramble_fix, default_play,
internal = TRUE,
Expand Down