vroom
vroom copied to clipboard
fix issue with empty date and datetime columns
In older versions of R, like 3.6.3, there is an error when reading an empty date or date-time column with skip = 1.
vroom::vroom(I('date\n'), col_names = 'date', col_types = 'D', skip = 1L)
Error in as.Date.numeric(double()) : 'origin' must be supplied
Calls: <Anonymous> ... collector_value.collector_date -> as.Date -> as.Date.numeric
vroom::vroom(I('dt\n'), col_names = 'dt', col_types = 'T', skip = 1L)
Error in as.POSIXct.numeric(double()) : 'origin' must be supplied
Calls: <Anonymous> ... collector_value.collector_datetime -> as.POSIXct -> as.POSIXct.numeric
This commit fixes the error by using a character() vector instead of a double() vector.
This fixes issue #453.