In R, I have followed the data class of the date:
20100701 20100702 Year, month and day data in 20100703 P> 3 column.
Just to mention, this can also be done by base Can be done with strptime and format.POSIXct (although the package may be less easily than lubridate ) package: x & lt; -c (20100701,20100702,20100703,20100704) striptime (x, format = "% Y% m% d") - & gt; Y data.fr (year = format (y, format = "% Y"), month = format (y, format = "% m"), day = format (y, format = "% d")) year month day 1 2010 07 01 2 2010 07 02 3 2010 07 03 4 2010 07 04
Comments
Post a Comment