Maximum number of columns that can be read using read.csv

烈酒焚心 提交于 2019-12-25 15:02:31

问题


I want to read a csv file of 4000 columns and 3000 rows and rows are of different length. Now i'm using the code below to read, but the maximum number of columns can be read is 2067.

read_data <- function(filename) {
  setwd(dir)
  no_col <- max(count.fields(filename, sep = ","))
  temp_data <- read.csv(filename, header = FALSE, sep = ",", row.names = NULL, na.strings = 0, fill = TRUE, col.names=1:no_col)

How do I solve this problem?

来源:https://stackoverflow.com/questions/33195978/maximum-number-of-columns-that-can-be-read-using-read-csv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!