[R] date format

bogdan romocea br44114 at gmail.com
Wed Aug 10 16:20:56 CEST 2005


You need the day to convert to a date format. Assuming day=15:
x.date <- as.Date(paste(as.character(x),"-15",sep=""),format="%Y-%m-%d")


> -----Original Message-----
> From: alessandro carletti [mailto:alxmilton at yahoo.it] 
> Sent: Wednesday, August 10, 2005 9:37 AM
> To: rHELP
> Subject: [R] date format
> 
> 
> Hi,
> I have a problem with a vector (x) containing dates in
> format "yyyy-mm" (I'm working with monthly means): how
> can I convert it in date format, so that I can plot it
> recognising trends for my variables?
> class(x) says: factor
> Thanks
> Alex
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list