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

name repo files #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

name repo files #4

wants to merge 2 commits into from

Conversation

stephenturner
Copy link
Contributor

fixes #3

Before:

yawp::read_repo(repo = "cdcepi/Flusight-forecast-data",
                branch = "master",
                pattern = "data-forecasts/.*/.*\\.csv",
                to_tibble = TRUE,
                .f = readr::read_csv,
                n_files=2,
                col_types="DcDccdd",
                progress=FALSE)
#> # A tibble: 192 × 7
#>    forecast_date target                  target_en…¹ locat…² type  quant…³ value
#>    <date>        <chr>                   <date>      <chr>   <chr>   <dbl> <dbl>
#>  1 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      point  NA     221. 
#>  2 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.01   81.6
#>  3 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.025  83.7
#>  4 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.05  108. 
#>  5 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.1   148. 
#>  6 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.15  179. 
#>  7 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.2   189. 
#>  8 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.25  200. 
#>  9 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.3   209. 
#> 10 2022-10-17    1 wk ahead inc flu hosp 2022-10-22  06      quan…   0.35  212. 
#> # … with 182 more rows, and abbreviated variable names ¹​target_end_date,
#> #   ²​location, ³​quantile

Created on 2022-11-06 with reprex v2.0.2

After:

yawp::read_repo(repo = "cdcepi/Flusight-forecast-data",
                branch = "master",
                pattern = "data-forecasts/.*/.*\\.csv",
                to_tibble = TRUE,
                .f = readr::read_csv,
                n_files=2,
                col_types="DcDccdd",
                progress=FALSE, 
                .id="forecast_filename")
#> # A tibble: 192 × 8
#>    forecast_filename    forecast…¹ target target_e…² locat…³ type  quant…⁴ value
#>    <chr>                <date>     <chr>  <date>     <chr>   <chr>   <dbl> <dbl>
#>  1 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      point  NA     221. 
#>  2 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.01   81.6
#>  3 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.025  83.7
#>  4 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.05  108. 
#>  5 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.1   148. 
#>  6 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.15  179. 
#>  7 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.2   189. 
#>  8 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.25  200. 
#>  9 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.3   209. 
#> 10 2022-10-17-CADPH-Fl… 2022-10-17 1 wk … 2022-10-22 06      quan…   0.35  212. 
#> # … with 182 more rows, and abbreviated variable names ¹​forecast_date,
#> #   ²​target_end_date, ³​location, ⁴​quantile

Created on 2022-11-06 with reprex v2.0.2

No errors/warnings. Did get a NOTE:

❯ checking dependencies in R code ... NOTE
  Namespaces in Imports field not imported from:
    ‘lifecycle’ ‘patchwork’ ‘readr’
    All declared Imports should be used.

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.

Name the repo files before reading
1 participant