Skip to content

Reading word by word in a dataset

3 messages · Liaw, Andy, John, Brian Ripley

#
Don't give up on read.table() just yet:
fill=TRUE)
             V1
1      i1-apple
2     i2-banana
3 i3-strawberry

Andy
2 days later
#
Dear Andy,
Why does my 'read.table()' NOT work in this example?
I have the error, "subscript out of bounds", as you
see below. My R version is 1.9.0.
i1-apple 10$ New_York
i2-banana 5$ London
i3-strawberry 7$ Japan
colClasses=c("character","NULL","NULL"), fill=T)
Error in data[[i]] : subscript out of bounds
NULL, NULL), fill=T)
             V1  V2       V3
1      i1-apple 10$ New_York
2     i2-banana  5$   London
3 i3-strawberry  7$    Japan
NULL, NULL), fill=T)[,1]
[1] "i1-apple"      "i2-banana"     "i3-strawberry"
Cheers,

John
--- "Liaw, Andy" <andy_liaw at merck.com> wrote:
------------------------------------------------------------------------------
------------------------------------------------------------------------------
#
On Thu, 4 Nov 2004, John wrote:

            
^^^^^

That is your problem. It works in the current version of R, 2.0.0. Using
colClasses=NULL was not documented in 1.9.0, and was not intended to work.

What does the posting guide say about this?