4 ms·
Might be the datatypes. fread automagically tries to determine the datatypes of your columns by jumping around the file as it's being read. https://www.rdocume
by nojito 5y ago
Might be the datatypes. fread automagically tries to determine the datatypes of your columns by jumping around the file as it's being read.
https://www.rdocumentation.org/packages/data.table/versions/1.14.0/topics/fread https://www.rdocumentation.org/packages/data.table/versions/...
Or you can pass colClasses = 'character' as an argument to read everything as a string, but that will be much much slower.
fread also reads from stdin so you can pass bash commands into the first parameter instead of using bash to run r via R -e.
- burntsushi 5y agoI guess that's nifty, but it makes it much less universal. It's also not clear to me why reading everything as a string would be slower. If anything, it seems to me like it would be faster, since you wouldn't need to do type guessing. Full disclosure, I'm the author of 'xsv' and the thing I was most interested in here was performance.