Reputation: 8646
In my tab-delimited data file (small sample can be downloaded here), first 2 lines are header lines which I need to skip, third line is empty and therefore should also be skipped, and actual data starts from line 4. When I try to read it via fread
with skip=3
argument:
dtRM3 <- fread("hg19.fa.out2.head.tsv", skip=3, sep="\t", header=F)
it gives a warning: Stopped reading at empty line 3, but text exists afterwards (discarded):
- then the warning shows the text of line 4. I don't understand why it's reading empty line 3 while I indicated to skip first 3 lines. If I make line 3 non-empty by putting any characters there, it is skipped correctly. Alternatively, if I tell to skip one more line -
dtRM4 <- fread("hg19.fa.out2.head.tsv", skip=4, sep="\t", header=F)
it skips correctly first 4 lines and starts from line 5.
Upvotes: 1
Views: 884
Reputation: 5536
The data reads in correctly (7 records, 15 variables with out header) if you run just fread("hg19.fa.out2.head.tsv")
with out any extra arguments. I can not explain it.
Upvotes: 2