[R] Dates stuff ... beginner question
ligges at statistik.uni-dortmund.de
Thu Apr 15 17:21:36 CEST 2004
MMarques Power wrote:
> Putting it simly I have a date in format YYYYMMDD
> Year month day
> and I need simply the day of the week as an integer or even as
> according to the documentation in ISOdate or strptime functions
> I need to format it ...
> If I try something like :
>  "2004-04-15"
> being %u the format value I need
> but as result I get the system actual date ??!?...
> Using Windows XP and the latest R1.9.0
> I need something like 1 for sunday and the sequent values for the rest
> of the week.
> What am I doing wrong...?
> Any help is welcomed...
You are looking for, e.g.:
format(strptime("20030301", "%Y%m%d"), "%A")
Note that the help says for format "%u":
" ... less widely implemented (e.g. not for output on Windows) ..."
> Thanks in advance
> Marco Marques
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help