| 1 |
\name{date2ISOweek} |
| 2 |
\alias{date2ISOweek} |
| 3 |
\title{Converts date from standard notation to week notation according to ISO 8601} |
| 4 |
\usage{ |
| 5 |
date2ISOweek(date) |
| 6 |
} |
| 7 |
\arguments{ |
| 8 |
\item{date}{Vector which can be coerced to class |
| 9 |
\code{Date}} |
| 10 |
} |
| 11 |
\value{ |
| 12 |
A character vector of year, week, and weekday in format |
| 13 |
"\code{\%Y-W\%V-\%u}" |
| 14 |
} |
| 15 |
\description{ |
| 16 |
This function returns the year, the week of the year, and |
| 17 |
the day of week of a given date according to ISO 8601. It |
| 18 |
is an substitute for the \code{\%Y-W\%V-\%u} format which |
| 19 |
is not implemented on Windows. |
| 20 |
} |
| 21 |
\details{ |
| 22 |
According to ISO 8601, the year of the week can differ |
| 23 |
from the calendar year (see the examples). |
| 24 |
} |
| 25 |
\examples{ |
| 26 |
x <- paste(1999:2011, "-12-31", sep = "") |
| 27 |
y <- as.Date(x) |
| 28 |
data.frame(date = format(y), weekdate = date2ISOweek(y)) |
| 29 |
data.frame(date = x, weekdate = date2ISOweek(x)) |
| 30 |
} |
| 31 |
\author{ |
| 32 |
Uwe Block \email{[email protected]} |
| 33 |
} |
| 34 |
\seealso{ |
| 35 |
\code{\link{strptime}} for a description of the date |
| 36 |
formats and references on ISO 8601. |
| 37 |
} |
| 38 |
|