ts2yearweek: Convert timestamp to year_week.

Description Usage Arguments Value Examples

View source: R/ts2yearweek.R

Description

ts2yearweek extracts the week of the year and the year from a timestamp and concatenates both to create a unique identifier for each week of the year. Around the turn of the year, sometimes, the week of the year switches already in the last days of the year, or does not switch at the first days of the new year. These days are corrected to maintain continuous numbering.

Usage

1

Arguments

ts

A vector with timestamps or dates in format POSIXct or Date.

Value

A vector with year_week identifier for each week of the year.

Examples

1
 ts2yearweek(as.Date("2017-01-01"))

maxkroeschel/activitytools documentation built on Jan. 15, 2019, 5:32 a.m.