The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Intro to cstime

Chi Zhang

2021-09-15

cstime 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.

cstime is part of the csverse package suite.

library(cstime)
#> cstime 2023.5.3
#> https://www.csids.no/cstime/
library(magrittr)

To convert a date to isoyear:

date_to_isoyear_c('2021-01-01')
#> [1] "2020"

To convert a isoyearweek string to isoyear/isoweek:

isoyearweek_to_isoyear_c("2021-02")
#> [1] "2021"
isoyearweek_to_isoweek_c("2021-02")
#> [1] "02"

To convert a season week to isoweek (and reverse):

seasonweek_to_isoweek_n(10)
#> [1] 10
isoweek_to_seasonweek_n(1)  
#> [1] 24

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.