I have a text file whose first 10 rows look like these:
3 a 1 4 6 2
3 a 1 4 6 2
4 a 1 4 6 8 2
4 a 1 4 6 8 2
3 a 1 4 6 2
3 a 1 4 6 2
3 a 1 4 6 2
3 a 1 4 6 2
3 a 1 4 6 2
3 a 1 4 6 2
5 a 1 4 8 10 2 6
5 a 2 6 8 10 2 4
5 a 1 4 8 10 2 6
5 a 1 4 8 10 2 6
5 a 2 6 8 10 2 4
I only want to read the first four columns of each row and save it in to a data frame.
I've tried with several codes, the last one being:
library(data.table)
nudos<-fread("caliz.txt",select=c(1:4),fill=TRUE)
which keeps giving this error message:
Stopped early on line 119. Expected 11 fields but found 13. Consider fill=TRUE and comment.char=. First discarded non-empty line: <<10 n 21 4 8 -14 2 -16 -18 -20 -6 -10 -12>>
Thanks!