[R] extract week from date

apjaworski@mmm.com apjaworski at mmm.com
Thu Apr 11 17:08:12 CEST 2002


I am not quite sure what the "week of a date" is, but here is my best
guess:

     > format(as.POSIXct("2002-04-11"), "%U")
     > 14

This returns a number between 0 and 53 representing the week-of-the-year.

Check the manpages for the date-related functions.

Andy

__________________________________
Andy Jaworski
Engineering Systems Technology Center
3M Center, 518-1-01
St. Paul, MN 55144-1000
-----
E-mail: apjaworski at mmm.com
Tel:  (651) 733-6092
Fax:  (651) 736-3122


                                                                                                                                               
                    "Juan Ramon                                                                                                                
                    Gonzalez"            To:     r-help at stat.math.ethz.ch                                                                      
                    <jrgonzalez at ico      cc:     (bcc: Andrzej P. Jaworski/US-Corporate/3M/US)                                                 
                    .scs.es>             Subject:     [R] extract week from date                                                               
                                                                                                                                               
                    04/11/2002                                                                                                                 
                    08:42                                                                                                                      
                                                                                                                                               
                                                                                                                                               





Hello R-users,

Does anyone know how obtain the week of a date?
(in SPPS the instruction is "xdate.week")

Thanks,

Juan Ramon

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list