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

Standardise data-raw scripts #1460

Merged
merged 3 commits into from Jan 12, 2023
Merged

Standardise data-raw scripts #1460

merged 3 commits into from Jan 12, 2023

Conversation

hadley
Copy link
Member

@hadley hadley commented Jan 12, 2023

  • Always produce standard tbls (not spec_tbl created by readr)
  • Fix deprecated functions
  • Standardise package loading
  • Create csvs for all external datasets

Fixes #1459


I verified that all datasets had the correct type with

data <- dir("data", full.names = TRUE)
data |> lapply(function(path) {
  env <- new.env()
  name <- load(path, envir = env)
  class(env[[name]])
})

and that all scripts worked in a fresh session with

scripts <- dir("data-raw", pattern = "\\.R$", full.names = TRUE)
for (script in scripts) {
  cat(script, "\n")
  callr::r(function(path) {
    source(path)
  }, list(path = script))
}

* Always produce standard tbls (not spec_tbl created by readr)
* Fix deprecated functions
* Standardise package loading
* Create csvs for all external datasets

Fixes #1459
Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cms_patient_experience seems to have changed a lot in the CSV, is that worrisome? It looks like it pulls from an API

@hadley
Copy link
Member Author

hadley commented Jan 12, 2023

Good point; let's treat the cached csv files as the source of truth.

@hadley hadley merged commit 36502c8 into main Jan 12, 2023
@hadley hadley deleted the data-tidying branch January 13, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove vroom/readr class from built in datasets
2 participants