I'm trying to read in a fairly simple csv file, but readr
is throwing an error when I try to specify the column types. Here's a small snippet of my data:
text <- "Item,Date,Time,SeizureTime,ET,OriginatingNumber,TerminatingNumber,IMEI,IMSI,CT,Feature,DIALED,FORWARDED,TRANSLATED,ORIG_ORIG,MAKE,MODEL,TargetNumber
3,10/31/2012,7:53:00,0:15,1:43,(123)555-1216,(123)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662
4,10/31/2011,9:04:00,0:25,0:00,(123)555-0214,(123)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662
9,10/31/2014,9:08:00,0:11,2:13,(123)555-8555,(132)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662
12,10/31/2011,9:27:00,0:07,0:10,(123)555-0214,(123)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662
13,10/31/2015,9:35:00,0:27,0:00,(123)555-0214,(123)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662
16,10/31/2011,10:09:00,0:10,14:13,(123)555-1216,(123)555-5662,,,MO,[],,11235552511,,,,,(123)555-5662"
dat <- read.table(text = text, sep = ",", header = TRUE)
When trying to read in the actual CSV using read_csv("file.csv", col_types = rep("c", times = 18))
I get the error mentioned in the title. I've seen a couple SO questions regarding this error and they all seem to be related to C++ functions taking place in the background, but I don't know how to remedy it. If I strip off the col_types
argument, the error goes away, but it doesn't parse the data correctly.