Skip to content
Prev 222081 / 398500 Next

reading in table with different number of elements in each row

This is in the Detail of the help page:

The number of data columns is determined by looking at the first five
lines of input (or the whole file if it has less than five lines), or
from the length of col.names if it is specified and is longer. This
could conceivably be wrong if fill or blank.lines.skip are true, so
specify col.names if necessary.


try:  read.table(..., col.names=1:30)

This will assume there are 30 columns of data (you only said a max of
15, but lets double it)

On Tue, May 25, 2010 at 8:05 PM, Johan Jackson
<johan.h.jackson at gmail.com> wrote: