1

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.

TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
eclairs
  • 1,515
  • 6
  • 21
  • 26

1 Answers1

0

Try this

strptime(mydata$col5, '%d-%b-%y') 
Sandipan Dey
  • 21,482
  • 2
  • 51
  • 63