convert_weekly | R Documentation |
This function will take a long format csse file (for example
something like that returned from get_us_from_cdp(cdp)
, or
the long format returned from cssedata()
, or the geo-level
elements in the list returney us_empirical_by_level()
) and
convert it from daily data to weekly format. The function will
use epiweek and epiyear from the lubridate package, and will
define the end of the week as day of week 7. The general approach
of the function is to sum up incident outcomes by epiweek/epiyear
combinations, and then generate weekly cumulative data by using
baseR cumsum
function.
convert_weekly(df, byvars = NULL)
df |
this is the source long formatted data described above |
byvars |
defaults to NULL, character vector of columns names to group by |
convert_weekly(us)
convert_weekly(get_state_from_cdp("Texas",cdp), byvar="USPS")
convert_weekly(county, byvars="FIPS")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.