R语言读取大数据data.table包fread函数-成都快上网建站

R语言读取大数据data.table包fread函数

> setwd("D:\\R_Tardy")
> library(data.table)
//  data.table 1.9.6  
// For help type ?data.table or 
// https://github.com/Rdatatable/data.table/wikiThe fastest way to learn (by data.table authors): 
//  https://www.datacamp.com/courses/data-analysis-the-data-table-way
> TestDT <- fread("test.txt", sep = "\t",header = FALSE, na.strings = "NA") 

// 查看文件前几行
> head(TestDT)
//  重 命 名 列的名字
> colnames(TestDT) <- c("ID","num","desc")
> head(TestDT)
> df <- TestDT[TestDT$desc %in% c("Heat group"), 1:ncol(TestDT), with=FALSE]
> df1 <- data.frame(df)
> nrow(df1)

网站栏目:R语言读取大数据data.table包fread函数
网页URL:http://kswjz.com/article/iiesih.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流