1

The function read.csv in R allows you to pass in colClasses in order to speed up the parsing process. One of the classes that you are allowed to pass in is Date. My data file has a date column in the %m/%d/%Y format - normally I read this in as a character vector using read.csv, then after that is complete I convert the column using as.Date(foo, "%m/%d/%Y").

Is there a way to pass a custom date format to read.csv so the date conversion can be done inside read.csv?

Arun
  • 116,683
  • 26
  • 284
  • 387
JCWong
  • 1,163
  • 1
  • 10
  • 29
  • Sorry, you're right this is an exact duplicate – JCWong Feb 20 '13 at 21:31
  • Also basically answered here: http://stackoverflow.com/questions/1523126/how-to-read-a-csv-file-in-r-where-some-numbers-contain-commas/3611619#3611619 – IRTFM Feb 20 '13 at 21:48

0 Answers0