Read.csv() throws error

后端 未结 7 694
暗喜
暗喜 2021-01-18 03:49

I have been trying to read the excel file but seems like there is something wrong. The file is stored in Documents folder in excel format.

These are the error mess

7条回答
  •  礼貌的吻别
    2021-01-18 04:37

    First of all, check that your CSV is in fact a CSV rather than an Excel file (you hint that that might be the case in your question). read.csv reads in delimited text files and can't handle Excel files (either .xls or .xlsx).

    If it is a delimited text file then looking at the error message looks like your CSV (well, tab separated values file) might have some empty column names which read.csv() is unable to handle.

    The second warning also then thinks that the last row of your file is incomplete which may be caused by whatever is outputting the file to combine separators when some of the fields are empty.

    They're warnings because they don't stop the program or exit it but it's saying that things might not be as you expect.

提交回复
热议问题