I have a column list of dates in data frame with date format 201001011200
as %Y%m%d%H%M
. I wanted to split them as %Y%m%d
and %H%M
as Date and Time.
I tried to as.Date(data$Date,origin = "1970-01-01")
but I got an error message
Error in charToDate(x) : character string is not in a standard unambiguous format
The class of the date is numeric
. So I tried to convert it to character
and applied the above as.Date
function but was not helpful.
Any idea? Thank you in advance.
EDIT
Here is a sample of my data:
Index Date rank amount
81211 201004090000 11 4.9
81212 201004090100 11 4.6
81213 201004090200 11 3.3
81214 201004090300 11 2.7
81215 201004090400 11 3.1
81216 201004090500 11 3.7
81217 201004090600 11 4.0
81218 201004090700 11 4.2
81219 201004090800 11 4.2
81220 201004090900 11 4.0