Description Usage Arguments Value Examples
Replacement for readLines, faster.
1 | fastReadLines(fname, newlinechar = "\n", nchars = NULL)
|
fname |
Filename to read. |
newlinechar |
The new line character in the file. |
A vector containing all the lines in the file.
1 2 3 4 5 6 7 8 9 | library(microbenchmark)
writeLines(replicate(100000, sample(letters, size=100, replace=T)), con="/tmp/temp.txt")
microbenchmark(fastReadLines("/tmp/temp.txt"),
readLines("/tmp/temp.txt"), times=3)[,c("expr", "mean"), drop=F]
Unit: milliseconds
expr min lq mean median uq
fastReadLines("/tmp/temp.txt") 335.3874 335.9188 336.5900 336.4502 337.1912
readLines("/tmp/temp.txt") 724.9136 725.4523 727.2444 725.9911 728.4098
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.