You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling read.csv.raw will fail if all rows are skipped and if colClasses are absent. The built-in function utils::read.csv after which the interface of the really great and fast iotools::read.csv.raw is modelled, does not fail. Would it be possible to catch this admittedly special case which, in my case, would make programming a bit easier?
Many thanks,
Daniel
A short reproducible example:
packageVersion("iotools") # ‘0.2.3’x<-matrix(sample(100), ncol=10)
write.csv(x, file="test.csv", row.names=FALSE)
read.csv("test.csv", skip=10) # dim == c(0, 11)
read.csv("test.csv", skip=10, colClasses= rep("integer", 10)) # dim == c(0, 11)
read.csv.raw("test.csv", skip=10) # Error in subset[, i] : subscript out of bounds
read.csv.raw("test.csv", skip=10, colClasses= rep("integer", 10)) # dim == c(0, 11)
unlink("test.csv")
By the way, I prefer the real/expected column names which are returned by read.csv.raw whenever colClasses are specified compared to the unexpected column names returned by read.csv ('X' concatenated with the values of the last and here skipped line [-- instead of "The default is to use "V" followed by the column number" quoting ?read.csv]).
The text was updated successfully, but these errors were encountered:
Calling read.csv.raw will fail if all rows are skipped and if colClasses are absent. The built-in function utils::read.csv after which the interface of the really great and fast iotools::read.csv.raw is modelled, does not fail. Would it be possible to catch this admittedly special case which, in my case, would make programming a bit easier?
Many thanks,
Daniel
A short reproducible example:
By the way, I prefer the real/expected column names which are returned by read.csv.raw whenever colClasses are specified compared to the unexpected column names returned by read.csv ('X' concatenated with the values of the last and here skipped line [-- instead of "The default is to use "V" followed by the column number" quoting ?read.csv]).
The text was updated successfully, but these errors were encountered: