I'm trying to import a CSV using read.table. Since specifying colClasses makes it faster, I tried to use it (it works without colCLasses, so I definitely know this is the issue). The following is the error I got:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
scan() expected 'an integer', got 'N44EU'
Now, this might be due to some mismatch in the classes specified, but I used this method to find the classes:
classes <- sapply(table_name,class)
Further, in the read.table function, for the argument colClasses, I inputted classes. This is when I got the error.
Full code:
initial <- read.table("Dognition.csv",header=TRUE, sep=",", quote="",na.strings = "NA")
classes <- sapply(initial,class)
final <- read.table("Dognition.csv",header=TRUE, sep=",", quote="",na.strings = "NA", colClasses= classes)
Why am I getting this error?