fread EOF instead of separator

后端 未结 2 815
无人及你
无人及你 2021-01-16 06:43

I\'m trying to read a huge file with fread, but i guess something is messed with the layout of the file.

If i try to read the file with

data = fread(         


        
相关标签:
2条回答
  • 2021-01-16 06:55

    Add fill = TRUE in the syntax

    What's happening: The rows in the data have unequal length. With this syntax, blank fields are implicitly filled.

    0 讨论(0)
  • 2021-01-16 07:00

    I'm not 100% sure what the error is in your data, here, but try running the code with

    data = fread(input = "../data.txt", sep = "\t", fill = TRUE)
    

    in the fread options. I had a similar error, and it seemed that fread was having trouble identifying my column separation. Setting fill to true allows fread to fill in any missing data- at least then you can check the resulting data frame and find out where the weirdness is.

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