Issue when importing dataset: `Error in scan(…): line 1 did not have 145 elements`

后端 未结 11 1256
我在风中等你
我在风中等你 2020-11-28 22:14

I\'m trying to import my dataset in R using read.table():

Dataset.df <- read.table(\"C:\\\\dataset.txt\", header=TRUE)

But

11条回答
  •  星月不相逢
    2020-11-28 22:38

    For others who can't find a solution and know the data isn't missing elements:

    I have this issue when I use Excel 2013 to save files as .csv and then try to load them in R using read.table(). The workaround I have found is to paste the data straight from Excel into a .txt document, then open with:

    read.table(file.choose(), sep="\t").
    

    I hope this helps.

提交回复
热议问题