eclairs eclairs - 2 months ago 9
R Question

Date: Date type in csv is uploaded as integer in R

I had uploaded a csv containing a date column. When i did

read.csv(
) in R and checked the typeof all columns, it displays all columns as integer type.
I was able to convert character types successfully by using :

as.character(mydata$col3)


When trying the similar for date (values as- 17-JAN-95) as:

as.date(mydata$col5,"%Y%M%D")


The values returned are:
please suggest the correct approach for modifying the datatype.

Answer

Try this

strptime(mydata$col5, '%d-%b-%y')