flusight.Rd
These functions are used to convert an original FluSight-formatted csv file to predx
data frame.
import_flusight_csv(file) export_flusight_csv(x, dir = NULL, overwrite = F) to_flusight_pkg_format(x) prep_flusight(x) flusight_ilinet_expected() flusight_state_ilinet_expected() flusight_hospitalization_expected() recode_flusight_bin_end_notincl(x)
file | A csv file formatted for the FluSight forecasting challenge. |
---|
A predx
data frame.
Note that if point forecasts (optional in the FluSight challenge) are included but are NAs, they will be removed (NA is not allowed in the Point class).
csv_tempfile <- tempfile('EW42-Hist-Avg-2018-10-29', fileext='.csv') write.csv(flusightdemo, csv_tempfile, row.names=F) import_flusight_csv(csv_tempfile)#> # A tibble: 14 x 8 #> location target unit team mmwr_week submission_date predx_class predx #> <chr> <chr> <chr> <chr> <dbl> <chr> <chr> <lis> #> 1 US Natio… 1 wk ahead perce… Hist… 42 2018-10-29 Point <Poi… #> 2 US Natio… 1 wk ahead perce… Hist… 42 2018-10-29 BinLwr <Bin… #> 3 US Natio… 2 wk ahead perce… Hist… 42 2018-10-29 Point <Poi… #> 4 US Natio… 2 wk ahead perce… Hist… 42 2018-10-29 BinLwr <Bin… #> 5 US Natio… 3 wk ahead perce… Hist… 42 2018-10-29 Point <Poi… #> 6 US Natio… 3 wk ahead perce… Hist… 42 2018-10-29 BinLwr <Bin… #> 7 US Natio… 4 wk ahead perce… Hist… 42 2018-10-29 Point <Poi… #> 8 US Natio… 4 wk ahead perce… Hist… 42 2018-10-29 BinLwr <Bin… #> 9 US Natio… Season on… week Hist… 42 2018-10-29 Point <Poi… #> 10 US Natio… Season on… week Hist… 42 2018-10-29 BinCat <Bin… #> 11 US Natio… Season pe… perce… Hist… 42 2018-10-29 Point <Poi… #> 12 US Natio… Season pe… perce… Hist… 42 2018-10-29 BinLwr <Bin… #> 13 US Natio… Season pe… week Hist… 42 2018-10-29 Point <Poi… #> 14 US Natio… Season pe… week Hist… 42 2018-10-29 BinCat <Bin…