Lubridate in R throws up infinite recursion error; but only after 48K rows

92 views Asked by At

My table "march" has 92,497 rows and two columns.

head(march)
   Unique.Key             ReportDate
1:   30062874 03/01/2015 12:08:00 AM
2:   30062909 03/01/2015 01:43:57 AM
3:   30062973 03/01/2015 01:36:21 AM
4:   30063031 03/01/2015 12:44:00 AM
5:   30063086 03/01/2015 01:22:59 AM
6:   30063107 03/01/2015 02:00:54 AM

I'm trying to convert the dates to POSIXct using lubridate. Starting with a smaller file of 500 rows, this:

march$ReportDate <- mdy_hms(march$ReportDate, tz="") 

gave me:

   Unique.Key          ReportDate
1:   30180483 2015-03-15 23:59:00
2:   30181183 2015-03-15 23:58:00
3:   30185134 2015-03-15 23:56:24

Trying to run it on the full table with 92K rows, I got this error:

Error: evaluation nested too deeply: infinite recursion / options(expressions=)?

Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?

Reducing number of rows, I was able to convert up to 48,000 rows. The error comes back at rows => 48,001. Line 48,001 itself looked fine. I skipped 47,999 rows in read.csv and the remaining 44K rows converted as expected.

The CSV is here. I'm on a Mac 10.9 and using Rstudio v0.98,

sessionInfo() 
R version 3.1.3 (2015-03-09) 
Platform: x86_64-apple-darwin13.4.0 (64-bit) 
Running under: OS X 10.9.1 

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 

attached base packages:
[1] stats graphics grDevices utils datasets methods base 

other attached packages:
[1] lubridate_1.3.3 plyr_1.8.2 data.table_1.9.4 

loaded via a namespace (and not attached):
[1] chron_2.3-45   digest_0.6.8     magrittr_1.5     memoise_0.2.1
[5] Rcpp_0.11.6    reshape2_1.4.1   stringi_0.4-1    stringr_1.0.0
[9] tools_3.1.3

Appreciate pointers/suggestions what's going on.

0

There are 0 answers