reading a specific line of a text file in R

file, line, r

Solution

Use `read.table()` and provide the number of lines to skip in the `skip` argument. Type in `?read.table` at the console for more information on additional arguments and wrappers that you can use.

Problem

I have a file in txt format separated by tabs. The question that I have is that if its possible to jump to an specific line, but without using a for loop, for example if I want to jump to the second line I have done this: ``` fileName="table.txt" con=file(fileName,open="r") for (i in 1:2){ ctable<-readLines(con,n=1) } ``` but I dont want to use a for loop, how I can do that? Thanks

Original source