I wonder if it would be possible to quickly obtain some info on larger-than-memory size data stored on disk, similar to, for example:
write.table(iris, 'test.csv', sep=",",row.names=FALSE,quote=FALSE)
info = function(file) {
tot = callr::r(
function(file) {
fread(file)[,.N]
}, package = 'data.table', args = list(file = readpath)
)
nmes = names(fread(file = readpath, nrows = 0L))
cat('\n found', tot, 'rows and', length(nmes), 'columns named:\n\n', sQuote(nmes), '\n')
return(invisible(list(tot, nmes)))
}
info('test.csv')
found 150 rows and 5 columns named:
‘Sepal.Length’ ‘Sepal.Width’ ‘Petal.Length’ ‘Petal.Width’ ‘Species’
system.time(info('test.csv'))
user system elapsed
0.01 0.00 0.27
but faster than that. Thank you!
I wonder if it would be possible to quickly obtain some info on larger-than-memory size data stored on disk, similar to, for example:
but faster than that. Thank you!