eclairs eclairs - 1 year ago 69
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

) 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 :


When trying the similar for date (values as- 17-JAN-95) as:$col5,"%Y%M%D")

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

Answer Source

Try this

strptime(mydata$col5, '%d-%b-%y') 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download