This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What's the fastest way to determine the number of rows of a CSV in R? | |
# ...Reading the entire CSV to only get the dimensions is likely too slow. Is there a faster way? | |
# Benchmarks done on a EC2 r3.8xlarge | |
# Cowritten with Abel Castillo <github.com/abelcastilloavant> | |
m <- 1000000 | |
d <- data.frame(id = seq(m), a = rnorm(m), b = runif(m)) | |
dim(d) | |
# [1] 1000000 3 | |
pryr::object_size(d) |