[R] Scanning data files line-by-line

Duncan Murdoch murdoch at stats.uwo.ca
Wed Apr 30 21:46:04 CEST 2003


On Wed, 30 Apr 2003 18:06:56 +0000, you wrote in message
<Law11-F85PZGGxWalhX00017a85 at hotmail.com>:

>I'm sorry to have to ask another question related to this.  What if
>the lines have variable number of fields?
 ...
>If I use scan with list( 0, "", 0 ), each line is treated as if it
>has a multiple of 3 elements, but really, what I want is to discard
>all fields after the third.

I'd try working with the fill=TRUE option, and give excess fields in
your list.

Duncan Murdoch



More information about the R-help mailing list