ISOweek2date {ISOweek}R Documentation

Converts date from week notation according to ISO 8601 to standard notation

Description

This function 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.

Usage

  ISOweek2date(weekdate)

Arguments

weekdate

A character vector of year, week, and weekday in format "%Y-W%V-%u"

Details

According to ISO 8601, the year of the week can differ from the calendar year (see the examples).

Value

A vector of class Date

Author(s)

Uwe Block u.block.mz@googlemail.com

See Also

strptime for a description of the date formats and references on ISO 8601.

Examples

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)

[Package ISOweek version 0.6-2 Index]