make_date_yw: Create dates from epidemiological weeks and years

Description Usage Arguments Details Value References Examples

View source: R/make_date_yw.R

Description

Calculate Gregorian calendar dates based on epidemiological years, week numbers, and weekday numbers.

Usage

1
make_date_yw(year = 1970L, week = 1L, weekday = 1L, system = "ISO")

Arguments

year

epidemiological year

week

eidemiological week number (1–53).

weekday

epidemiological weekday number (1–7). Day 1 is a Monday in the ISO-8601 WHO system and a Sunday in the CDC system.

system

String indicating the standard (WHO ISO-8601 or CDC epi weeks) that the weeks of the year in epidemiological and environmental reference data use ["ISO" or "CDC"]. (Required: epidemiological observation dates listed are LAST day of week).#'

Details

Arguments 'year', 'week', and 'weekday' are recycled as necessary.

Value

A vector of class 'Date'.

References

https://en.wikipedia.org/wiki/ISO_week_date https://www.cmmcp.org/sites/cmmcp/files/uploads/spring_skeeter_06.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
make_date_yw(2017, 1)
make_date_yw(2017, 1, 2)
make_date_yw(2017, 1, system = "CDC")
make_date_yw(2017, 1, system = "ISO")
make_date_yw(2017, 1, 2, system = "ISO")

# arguments are recycled
make_date_yw(2017, 1:10)
make_date_yw(2017, 1, 1:7)
make_date_yw(2010:2017, 1)

EcoGRAPH/epidemiar documentation built on Nov. 13, 2020, 5:31 p.m.