Read.csv() throws error

后端 未结 7 695
暗喜
暗喜 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:40

    I had a similar error, e.g:

    A <- read.csv("tel.csv", sep = ",")
    Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
      empty beginning of file
    In addition: Warning messages:
    1: In read.table(file = file, header = header, sep = sep, quote = quote,  :
      invalid input found on input connection 'tel.csv'
    2: In read.table(file = file, header = header, sep = sep, quote = quote,  :
      line 1 appears to contain embedded nulls
    3: In read.table(file = file, header = header, sep = sep, quote = quote,  :
      incomplete final line found by readTableHeader on 'tel.csv'
    

    For solution I tried:

    A <- read.csv("tel.csv", sep = ",",
                  fileEncoding="utf-16")
    

    It worked.

    0 讨论(0)
提交回复
热议问题