R read.csv “More columns than column names” error

后端 未结 5 586
半阙折子戏
半阙折子戏 2020-12-29 17:40

I have a problem when importing .csv file into R. With my code:

t <- read.csv(\"C:\\\\N0_07312014.CSV\", na.string=c(\"\",\"null\",\"NaN\",\"         


        
5条回答
  •  情深已故
    2020-12-29 17:55

    Open the .csv as a text file (for example, use TextEdit on a Mac) and check to see if columns are being separated with commas.

    csv is "comma separated vectors". For some reason when Excel saves my csv's it uses semicolons instead.

    When opening your csv use:

    read.csv("file_name.csv",sep=";")
    

    Semi colon is just an example but as someone else previously suggested don't assume that because your csv looks good in Excel that it's so.

提交回复
热议问题