epiwday: Get epidemiological weekday number of a date-time

Description Usage Arguments Details Value References Examples

View source: R/epiwday.R

Description

Returns the epidemiological weekday number using either ISO or CDC system.

Usage

1
epiwday(x, system = "ISO")

Arguments

x

a date-time object. Must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, or fts object.

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

The WHO system uses the ISO 8601 standard in which weeks start on Monday, while in the CDC system weeks start on Sunday.

Value

The weekday number (1–7) as an integer vector.

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
epiwday(as.Date("2005-01-01")) # 6
epiwday(as.Date("2005-01-01"), system = "ISO") # 6
epiwday(as.Date("2005-01-01"), system = "CDC") # 7

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