用R语言来读取600多M的txt文件,使用常用的read.table,太费时间。想起之前用readr包来读取csv、spss的、sas、excel的很快,便尝试了翻。
直接上代码:
> library(readr)
> a1=Sys.time()
> BRCA_RNAseqGene<-read_delim("20151101-BRCA-RNAseqGene.txt", "\t", escape_double = FALSE, trim_ws = TRUE)
Parsed with column specification:
cols(
.default = col_character()
)
See spec(...) for full column specifications.
|================================================================================| 100% 611 MB
| 0%
Warning message:
Duplicated column names deduplicated:

这篇博客分享了如何使用R语言中的readr包快速读取大型txt文件,通过实例展示,仅用44秒即可完成600多M的txt文件读取,显著提升了数据读取效率。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



