add_epi_week: Add Epi-weeks and Epi-years to a Data Frame

Description Usage Arguments Details Value See Also Examples

Description

add_epi_week takes a data frame that already contains a date column and adds columns for epi-week and epi-year.

Usage

1
add_epi_week(data, date_col, system = "who", ...)

Arguments

data

A data frame

date_col

Name of date column

system

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

...

Additional parameters passed to as.Date

Details

If you do not provide the name of the date column in the supplied data frame, the function looks for a column named "date". If it doesn't find one, it stops with an error. #'

Value

A data frame

See Also

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

Examples

1
2
3
4
add_epi_week(data.frame(mydate = seq(as.Date("2014-12-26"),
                                 as.Date("2015-01-12"),
                                 by = "day")),
             "mydate")

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