week_id_from_date: Get week ID from date

Description Usage Arguments Value

View source: R/ita_data_prep_functions.R

Description

Given a text representation of a date, get the 1-indexed ID for week of the year associated with that date. Example: '2020-01-01' -> 1

Usage

1
week_id_from_date(date, tryFormats = c("%Y-%m-%d", "%Y/%m/%d"))

Arguments

date

String representation of a date (singleton or vector). Can also be an object or vector of type Date, in which case it will not be converted

tryFormats

[optional] Formats to try when converting the string representation of a date into a Date object. Defaults to the default formats tried by 'as.Date()', " 'date' parameter is already of type Date

Value

integer vector giving week of the year


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.