Re: [R] How to import specific column(s) using read.table?

2004-08-10 Thread Gabor Grothendieck
Gabor Grothendieck ggrothendieck at myway.com writes: : : F Duan f.duan at yale.edu writes: : : I have a very big tab-delim txt file with header and I only want to import : several columns into R. I checked the options for read.table and only : : Try using scan with the what=list(...) and

Re: [R] How to import specific column(s) using read.table?

2004-08-10 Thread F Duan
Thanks a lot. Your way works perfect. And one more tiny question related to your codes: My data file has many columns to be omitted (suppose the first 20 ones), but I found scan(myfile, what=list(rep(NULL, 20), rep(0, 5)) doesn't work. I had to to type NULL 20 times and 0 five times in the

RE: [R] How to import specific column(s) using read.table?

2004-08-10 Thread Liaw, Andy
Use as.list. Andy From: F Duan Thanks a lot. Your way works perfect. And one more tiny question related to your codes: My data file has many columns to be omitted (suppose the first 20 ones), but I found scan(myfile, what=list(rep(NULL, 20), rep(0, 5)) doesn't work. I had to

Re: [R] How to import specific column(s) using read.table?

2004-08-10 Thread Tony Plate
At Tuesday 01:55 PM 8/10/2004, F Duan wrote: Thanks a lot. Your way works perfect. And one more tiny question related to your codes: My data file has many columns to be omitted (suppose the first 20 ones), but I found scan(myfile, what=list(rep(NULL, 20), rep(0, 5)) doesn't work. I had to to

[R] How to import specific column(s) using read.table?

2004-08-09 Thread F Duan
Dear R people, I have a very big tab-delim txt file with header and I only want to import several columns into R. I checked the options for “read.table” and only found “nrows” which lets you specify the maximum number of rows to read in. Although I can use some text editors (e.g., wordpad) to

Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread Thomas Lumley
On Mon, 9 Aug 2004, F Duan wrote: Dear R people, I have a very big tab-delim txt file with header and I only want to import several columns into R. I checked the options for “read.table” and only found “nrows” which lets you specify the maximum number of rows to read in. Although I can use

Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread A.J. Rossini
If you've got access to unix tools (i.e. linux or cygwin), consider the cut command. Great for column selection. Thomas Lumley [EMAIL PROTECTED] writes: On Mon, 9 Aug 2004, F Duan wrote: Dear R people, I have a very big tab-delim txt file with header and I only want to import several

Re: [R] How to import specific column(s) using read.table?

2004-08-09 Thread Prof Brian Ripley
There is no way for read.table to skip columns. It is however very easy to do this with a preprocessing of the table: cut, awk and perl all come to mind, and you could do it in R too, reading a block of rows at a time and writing them back out. scan() can skip columns, but I would still use