epi_week_date: Date Conversion from Epidemiological Weeks

Description Usage Arguments Details Value See Also Examples

Description

Function to calculate dates from epidemiological weeks.

Usage

1
epi_week_date(epi_week, epi_year, offset = 0, system = "who")

Arguments

epi_week

An object that can be coerced to a numeric

epi_year

An object that can be coerced to a numeric

offset

A number of days to offset the returned dates by. The default is 0 in which case the function returns the date of the first day of each epi week. An offset of 6 would instead return the date of the last day of each epi week.

system

Either "who" or "cdc". Defauly is "who". See epi_week for details.

Details

This function determines the date of the first day of each epi-week, optionally adding an offset to calculate the date of the last day of the week, or any other arbitrary amount.

epi_week and epi_year are recycled if necessary.

Value

A Date vector

See Also

Other epi.calendar.functions: add_epi_week; epi_week; epi_year_start

Examples

1
2
3
4
epi_week_date(1, 2010:2015)
epi_week_date(1:52, 2015)
epi_week_date(1:52, 2015, offset = 6) # return epi week end dates
epi_week_date(c(-1, 0, TRUE, 52, 53, 999, "a", NA), 2015) # NAs

chrismerkord/epical documentation built on May 13, 2019, 6:55 p.m.