Hi, Try this: Year<-c("01/2000","02/2000","03/2000")
#If you want to convert it directly to month/year library(zoo) as.yearmon(Year,format="%m/%Y") [1] "Jan 2000" "Feb 2000" "Mar 2000" #As your intention is to have DD/MM/YYYY format, Year1<-paste("01/",Year,sep="") Year1 [1] "01/01/2000" "01/02/2000" "01/03/2000" Year<-as.Date(Year1, format="%m/%d/%Y") Year [1] "2000-01-01" "2000-01-02" "2000-01-03" dat1<-data.frame(Year1,Stock_Prices=1:3) > dat1 Year1 Stock_Prices 1 01/01/2000 1 2 01/02/2000 2 3 01/03/2000 3 dat2<-data.frame(Year,Stock_Prices=1:3) > dat2 Year Stock_Prices 1 2000-01-01 1 2 2000-01-02 2 3 2000-01-03 3 A.K. ----- Original Message ----- From: Akhil dua <akhil.dua...@gmail.com> To: r-help@r-project.org Cc: Sent: Wednesday, July 4, 2012 12:13 AM Subject: [R] Date Hi I have monthly data and the dates are in MM/YY Format I need to convert them into DD/MM/YY format by pasting 01 in place of DD to all the observations in my Year Column ex: Year Stock Prices 01/2000 1 02/2000 2 03/2000 3 I need to convert them to Year Stock Prices 01/01/2000 1 01/02/2000 2 01/03/2000 3 [[alternative HTML version deleted]] ______________________________________________ R-help@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. ______________________________________________ R-help@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.