Description Usage Arguments Details Value Author(s) See Also Examples
Returns the date of a given weekdate (year, week of the year, day of week according
to ISO 8601). It is the inverse function to date2ISOweek
and a substitute for
strptime(x, "%G-W%V-%u")
.
1 | ISOweek2date(weekdate)
|
weekdate |
A character vector of year, week, and weekday in format " |
strptime
accepts but ignores the conversion specifications
%g
, %G
, %V
on input.
According to ISO 8601, the year of the week can differ from the calendar year (see the examples).
A vector of class Date
Uwe Block u.block.mz@gmail.com
The inverse function date2ISOweek
. strptime
for a
description of conversion specifications and references on ISO 8601.
1 2 3 4 5 6 7 | w <- paste("2009-W53", 1:7, sep = "-")
data.frame(weekdate = w, date = ISOweek2date(w))
# convert from calendar date to week date and back to calendar date
x <- paste(1999:2011, "-12-31", sep = "")
w <- date2ISOweek(x)
d <- ISOweek2date(w)
data.frame(date = x, weekdate = w, date2 = d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.