Description Usage Arguments Details Value Author(s) See Also Examples
Returns the year, the week of the year, and the day of week of a given date
according to ISO 8601. It is an alternative to strftime(x, "%G-W%V-%u")
.
1 |
date |
Vector which can be coerced to class |
The conversion specifications %g
, %G
, %u
, %V
where not available on Windows and MacOS before R 3.1.0
.
According to ISO 8601, the year of the week can differ from the calendar year (see the examples).
A character vector of year, week, and weekday in format "%G-W%V-%u
"
Uwe Block u.block.mz@gmail.com
The inverse function ISOweek2date
. strftime
for a
description of conversion specifications and references on ISO 8601.
1 2 3 4 | x <- paste(1999:2011, "-12-31", sep = "")
y <- as.Date(x)
data.frame(date = format(y), weekdate = date2ISOweek(y))
data.frame(date = x, weekdate = date2ISOweek(x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.