ISOweekday: Day of week according to ISO 8601

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Returns the weekday of a given date according to ISO 8601. It is an alternative to strftime(x, "%u").

Usage

1

Arguments

date

vector which can be coerced to class Date

Details

The conversion specifications %g, %G, %V, %u where not available on Windows and MacOS before R 3.1.0.

Value

An integer vector of weekdays (1-7, Monday is 1)

Author(s)

Uwe Block [email protected]

See Also

strftime

Examples

1
2
3
4
x <- paste(1999:2011, "-12-31", sep = "")
y <- as.Date(x)
data.frame(date = format(y), weekday = ISOweekday(y))
data.frame(date = x, weekday = ISOweekday(x))

UweBlock/ISOweek documentation built on May 9, 2019, 9:41 p.m.