In read.table(): incomplete final line found by readTableHeader

前端 未结 7 1907
谎友^
谎友^ 2020-12-29 21:58

I have a CSV when I try to read.csv() that file, I get the warning warning message:

In read.table(file = file, header = header, sep = sep, quote         


        
相关标签:
7条回答
  • 2020-12-29 22:59

    I had similar issue which didn't get resolved by the "enter method". After the mentioned error, I noticed the row count of the data frame was lesser than that of CSV. I noticed some non-alpha numeric values were hindering the import to R.

    I followed Aurezio comment on [below link] (https://stackoverflow.com/a/29150226) to remove non-alpha numeric values (I included space)

    Here the snippet:

    Function CleanCode(Rng As Range)
        Dim strTemp As String
        Dim n As Long
    
        For n = 1 To Len(Rng)
            Select Case Asc(Mid(UCase(Rng), n, 1))
                Case 32, 48 To 57, 65 To 90
                    strTemp = strTemp & Mid(UCase(Rng), n, 1)
            End Select
        Next
        CleanCode = strTemp
    End Function
    

    I then used CleanCode as a function for the final result

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