[R] handle dates in R?

Armstrong, Whit whit.armstrong at highbridge.com
Thu Sep 13 14:30:36 CEST 2007


dts <- c("2004-8-1","2004-10-1","2001-9-1")
strptime(dts,"%Y-%m-%d")
julian(strptime(dts,"%Y-%m-%d")) 


> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of zhijie zhang
> Sent: Thursday, September 13, 2007 8:19 AM
> To: R-help at stat.math.ethz.ch
> Subject: [R] handle dates in R?
> 
> Dear Rusers,
>   I have some data in .csv file like "2004-8-1" and 
> "2004-10-1", and i  need to convert them into days from the 
> origin (January 1, 1960).
> I have tried the function date.mmddyyyy(), but cannot get it. 
> Anybody can show me how to handle the date data?
>   Thanks very much!
> 
> My dataset like:
> time
> 2004-8-1
> 2004-10-1
> 2001-9-1
> 2002-9-1
> 
> 
> --
> With Kind Regards,
> 
> oooO:::::::::
> (..):::::::::
> :\.(:::Oooo::
> ::\_)::(..)::
> :::::::)./:::
> ::::::(_/::::
> :::::::::::::
> [*************************************************************
> **********]
> Zhi Jie,Zhang ,PHD
> Tel:86-21-54237149
> Dept. of Epidemiology,School of Public Health,Fudan 
> University Address:No. 138 Yi Xue Yuan Road,Shanghai,China
> Postcode:200032
> Email:epistat at gmail.com
> Website: www.statABC.com
> [*************************************************************
> **********]
> oooO:::::::::
> (..):::::::::
> :\.(:::Oooo::
> ::\_)::(..)::
> :::::::)./:::
> ::::::(_/::::
> :::::::::::::
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 




This e-mail message is intended only for the named recipient(s) above. It may contain confidential information. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and delete the message and any attachment(s) from your system. Thank you.



More information about the R-help mailing list