new_epiweek: Minimal constructor for an epiweek object

View source: R/epiweek.R

new_epiweekR Documentation

Minimal constructor for an epiweek object

Description

new_epiweek() is a constructor for ⁠<grates_epiweek>⁠ objects aimed at developers.

Usage

new_epiweek(x = integer())

is_epiweek(xx)

Arguments

x

⁠[integer]⁠

Vector representing the number of weeks.

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

xx

R 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.

Value

A ⁠<grates_epiweek>⁠ object.

See Also

new_yearweek() and new_isoweek().

Examples

new_epiweek(1:10)


grates documentation built on July 9, 2023, 7:09 p.m.