R 读取csv文件

R 读取csv文件,r,csv,import,dropbox,R,Csv,Import,Dropbox,我无法将.csv文件读入R,例如 df1991 <- read.csv("http://dl.dropbox.com/s/vwdw2tsmgiiuxfa/1991.csv") Error in read.table(file = file, header = header, sep = sep, quote = quote, : more columns than column names fishdata <- read.csv("http://dl.dropbox.com/

我无法将.csv文件读入R,例如

df1991 <- read.csv("http://dl.dropbox.com/s/vwdw2tsmgiiuxfa/1991.csv")
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
more columns than column names

fishdata <- read.csv("http://dl.dropbox.com/s/pin16l691p6j4ll/fishdata.csv", row.names=NULL)
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
more columns than column names

df1991可接受的CSV,因此可能是您的默认设置。区域设置(对于解释为十进制的逗号)

是否错误消息应该是另一种情况,即列名多于列


抓住这根稻草,第一列数据可能会被解释为行标签,而不需要列名称。然后,它希望所有给定的列名都与第一列之后的数据列相关。因此,列名比列多。通过类似“row names=1”的导入参数进行解析。

这两个参数对我都适用,没有错误。与@Thomas一样,这两个参数对我都适用。你尝试过干净的会话吗?不,事实上,我只是重新启动Rstudio吗?对我也很有用。。。可能重新启动计算机,并运行“rm(list=ls())”以从R工作区中删除所有对象。最后一件事:插入'fill=TRUE'作为read.csv的额外参数,看看这是否会改变什么。感谢您的帮助。Rstudio本身似乎阻止了我从网上读取数据,因为它在独立的R控制台中工作得很好。