Skip and autostart in fread

I use the following code to read the file with the data.table library:

fread(myfile, header=FALSE, sep=",", skip=100, colClasses=c("character","numeric","NULL","numeric"))

but I get the following error:

The supplied 'sep' was not found on line 80. To read the file as a single character column set sep='\n'.

It says that he did not find sep on line 80, however I set skip = 100, so he should not pay attention to the first 100 lines.

UPDATE: I tried with skip = 101 and it worked, but it skips the first line where the data starts

I am using version 1.9.2 of the data.table package and R version 3.02 of 64 bits on Windows 7

+4
source share
1 answer

We do not know the version number that you are using, but I can guess in this case.

Try to install autostart=101.

Pay attention to the first paragraph of the Details in ?fread:

autostart, . autostart , , . , , . , . skip>0 , autostart=skip+1 .

skip :

-1 ( ), , , , . skip >= 0 + 1 ( = "" | TRUE | FALSE, ). skip = "string" (, ) ( read.xls gdata).

autostart:

30. (, ), ( ). sep, sep2 . , , - .

, , 30 , , autostart=101 . skip.

, . autostart , , , . , , skip. fread . , , .

+4

Source: https://habr.com/ru/post/1529353/


All Articles