fullstack-data-engineer icon indicating copy to clipboard operation
fullstack-data-engineer copied to clipboard

R中使用read.csv读取豆瓣电影数据时出错:列的数目比列的名字要多

Open Honlan opened this issue 8 years ago • 0 comments

我提供的豆瓣电影数据某些行存在缺失值,所以有的行的列数不一样,在mac下会自动处理,但是在windows下会报错。

可以尝试使用data.table包的fread()函数,读文件功能更强: douban_movie_clean <- fread(filepath, header=TRUE, sep="^", encoding="UTF-8")

Honlan avatar Feb 24 '17 05:02 Honlan