knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
fhitime
provides date time functions for public health purposes.
The core functionality is consistent time conversion between
It also provides functions to generate rolling dates for computing the weekly, bi-weekly, 4 week averages.
fhitime
is part of the fhiverse
package suite.
library(fhitime) library(magrittr)
To convert a date to a year/week:
date_to_isoyear_c('2021-01-01')
To convert a year-week string to year/week:
isoyearweek_to_isoyear_c("2021-02") isoyearweek_to_isoweek_c("2021-02")
To convert a season week to ISO (natural) week:
seasonweek_to_isoweek_n(10) isoweek_to_seasonweek_n(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.