Description Usage Arguments Value Author(s) See Also Examples
This function returns the weekday of a given date
according to ISO 8601. It is an substitute for the
"%u
" format which is not implemented on Windows.
1 |
date |
Vector which can be coerced to class
|
An integer vector of weekdays (1-7, Monday is 1)
Uwe Block u.block.mz@googlemail.com
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))
|
date weekday
1 1999-12-31 5
2 2000-12-31 7
3 2001-12-31 1
4 2002-12-31 2
5 2003-12-31 3
6 2004-12-31 5
7 2005-12-31 6
8 2006-12-31 7
9 2007-12-31 1
10 2008-12-31 3
11 2009-12-31 4
12 2010-12-31 5
13 2011-12-31 6
date weekday
1 1999-12-31 5
2 2000-12-31 7
3 2001-12-31 1
4 2002-12-31 2
5 2003-12-31 3
6 2004-12-31 5
7 2005-12-31 6
8 2006-12-31 7
9 2007-12-31 1
10 2008-12-31 3
11 2009-12-31 4
12 2010-12-31 5
13 2011-12-31 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.