changing date format in a dataframe
Le mercredi 16 novembre 2011 ? 06:12 -0800, arunkumar1111 a ?crit :
Hi I have a data frame and i need to change the date format in it. my dataframe X Date 1 1/1/2009 2 2/1/2009 3 3/1/2009 I need to change it to 2009-01-01
See ?as.Date. In your case, I think you should use df[[2]] <- as.Date(df[[2]], format="%d/%m/%Y") This is assuming df is your dataframe, and that you're using the day/month/year syntax. To print it into another format, see ?format.Date Regards