[R] reading in only one column from text file

Berton Gunter gunter.berton at gene.com
Tue Mar 7 23:07:22 CET 2006


You are not reading the Help file correctly. It says:

"Character.A vector of classes to be assumed for the columns. Recycled as
necessary."
  ^^^^^^^^^^^^^^^^

colClasses=NULL) means that you have no colClasses argument. It does exactly
what you tell it to (use whatever defaults it has, inother words). 

c("numeric","NULL",...)) ## however many more columns you have for ...
Please note the **quotes** . It behaves as documented.


-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
  

> -----Original Message-----
> From: mark salsburg [mailto:mark.salsburg at gmail.com] 
> Sent: Tuesday, March 07, 2006 1:57 PM
> To: Berton Gunter
> Subject: Re: [R] reading in only one column from text file
> 
> I've tried that:
> 
> read.table(myData, colClasses = NULL)
> 
> colClasses doesn't seem to do anything when I put in NULL.
> 
> How do I tell R to skip the 2nd column i'm reading in???
> 
> thank you,
> 
> 
> 
> 
> On 3/7/06, Berton Gunter <gunter.berton at gene.com> wrote:
> 
> 	See the "NULL" value for argument colClasses of read.table().
> 	
> 	-- Bert Gunter
> 	Genentech Non-Clinical Statistics
> 	South San Francisco, CA
> 	
> 	"The business of the statistician is to catalyze the 
> scientific learning 
> 	process."  - George E. P. Box
> 	
> 	
> 	
> 	> -----Original Message-----
> 	> From: r-help-bounces at stat.math.ethz.ch
> 	> [mailto: r-help-bounces at stat.math.ethz.ch 
> <mailto:r-help-bounces at stat.math.ethz.ch> ] On Behalf Of mark salsburg
> 	> Sent: Tuesday, March 07, 2006 1:30 PM
> 	> To: R-help at stat.math.ethz.ch
> 	> Cc: r-help at stat.math.ethz.ch 
> <mailto:r-help at stat.math.ethz.ch> 
> 	> Subject: [R] reading in only one column from text file
> 	>
> 	> How do I manipulate the read.table function to read 
> in only the 2nd
> 	> column???
> 	>
> 	>       [[alternative HTML version deleted]] 
> 	>
> 	> ______________________________________________
> 	> R-help at stat.math.ethz.ch mailing list
> 	> https://stat.ethz.ch/mailman/listinfo/r-help 
> 	> PLEASE do read the posting guide!
> 	> http://www.R-project.org/posting-guide.html
> 	>
> 	
> 	
> 
> 
>




More information about the R-help mailing list