R读取文本文件后,获得数据的类型转换


x<-read.delim("C:/Users/liutz/Documents/101名健康女职工血清总胆固醇测量结果.txt")
head(x)
#y<-as.numeric(x)
#错误: 'list' object cannot be coerced to type 'double'
y<-as.numeric(unlist(x))
write.csv(y,file="data.csv")
hist(y,breaks=12,main="直方图")

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注