signaturescience / fiphde

Forecasting Influenza in Support of Public Health Decision Making
https://signaturescience.github.io/fiphde/
GNU General Public License v3.0
3 stars 1 forks source link

Remove cdcfluview dependency #121

Closed stephenturner closed 1 year ago

stephenturner commented 2 years ago

Fixes #120 tagging @vpnagraj for review/merge, @chulmelowe for awareness

Functions return identical results:

suppressPackageStartupMessages(suppressWarnings(library(tidyverse)))

ilinet_f <- map_df(c("national", "hhs", "census", "state"), fiphde::ilinet)
ilinet_c <- map_df(c("national", "hhs", "census", "state"), cdcfluview::ilinet)

identical(ilinet_f, ilinet_c)
#> [1] TRUE

hospitalizations_f <- map(c("flusurv", "eip", "ihsp"), fiphde::hospitalizations)
hospitalizations_c <- map(c("flusurv", "eip", "ihsp"), cdcfluview::hospitalizations)

identical(hospitalizations_f, hospitalizations_c)
#> [1] TRUE

Installs without issue on our in-house Linux server, loads, and relevant functions work:

remotes::install_github("signaturescience/fiphde", ref="120-cdcfluview")
> library(fiphde)
> get_cdc_ili(region="national", years=2021)
Latest week_start / year / epiweek available:
2022-06-26 / 2022 / 26
# A tibble: 39 × 13
   location region_type abbreviation region epiyear epiweek week_start
   <chr>    <chr>       <chr>        <chr>    <int>   <int> <date>
 1 US       National    US           US        2021      40 2021-10-03
 2 US       National    US           US        2021      41 2021-10-10
 3 US       National    US           US        2021      42 2021-10-17
 4 US       National    US           US        2021      43 2021-10-24
 5 US       National    US           US        2021      44 2021-10-31
 6 US       National    US           US        2021      45 2021-11-07
 7 US       National    US           US        2021      46 2021-11-14
 8 US       National    US           US        2021      47 2021-11-21
 9 US       National    US           US        2021      48 2021-11-28
10 US       National    US           US        2021      49 2021-12-05
# … with 29 more rows, and 6 more variables: weighted_ili <dbl>,
#   unweighted_ili <dbl>, ilitotal <dbl>, num_of_providers <dbl>,
#   total_patients <dbl>, population <dbl>

Dependency heaviness analysis (pkgndep):

fiphde