Skip to content
Prev 277574 / 398506 Next

changing date format in a dataframe

Le mercredi 16 novembre 2011 ? 06:12 -0800, arunkumar1111 a ?crit :
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