Skip to contents

epiweek() is a constructor for <grates_epiweek> objects.

Usage

epiweek(year = integer(), week = integer())

Arguments

year

[integer]

Vector representing the year associated with week.

double vectors will be converted via as.integer(floor(x)).

week

[integer]

Vector representing the week associated with `year.

double vectors will be converted via as.integer(floor(x)).

Value

A <grates_epiweek> object.

Details

Epiweeks are defined to start on a Sunday and <grates_epiweek> objects are stored as the number of weeks (starting at 0) from the first Sunday after the Unix Epoch (1970-01-01). That is, the number of seven day periods from 1970-01-04.

Internally they have the same representation as a <grates_yearweek_sunday> object so are akin to an alias but with a marginally more efficient implementation.

See also

Examples

epiweek(year = 2000L, week = 3L)
#> <grates_epiweek[1]>
#> [1] "2000-W03"