[R] how to delete a matrix column

Simon Fear Simon.Fear at synequanon.com
Wed Mar 3 10:44:00 CET 2004


I would recommend here

y <- subset(x, select= -someColName)

which is not xref'd from ?"[" (though the obscure .subset is),
and is not mentioned in the relevant section of the 
Introduction to R either.

I once foolishly offered to amend this section of the manual,
but I have subsequently realised that I haven't the faintest idea
how to even start doing that.

> -----Original Message-----
> From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
> Sent: 02 March 2004 19:22
> To: Rolf Turner
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] how to delete a matrix column
> 
> 
> Security Warning: 
> If you are not sure an attachment is safe to open contact 
> Andy on x234. 
> There are 0 attachments with this message. 
> ________________________________________________________________ 
>  
> On Tue, 2 Mar 2004, Rolf Turner wrote:
> 
> > Aimin Yan wrote:
> > 
> > > I am new to R, How to delete a matrix column.
> > 
> > e.g. y <- x[,-5] deletes column 5
> > 
> > I was going to point out to the inquirer where this feature
> > is documented --- but I can't bleedin' find it!!!
> > 
> > Can anyone tell me?  I tried ?"[" but got no joy that
> > I could discern.
> 
> `An Introduction to R', for one.
> 
> The help page for "[" is long enough, but needs to be split/have some 
> xrefs added for things like this.
> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html  
 
Simon Fear 
Senior Statistician 
Syne qua non Ltd 
Tel: +44 (0) 1379 644449 
Fax: +44 (0) 1379 644445 
email: Simon.Fear at synequanon.com 
web: http://www.synequanon.com 
  
Number of attachments included with this message: 0 
  
This message (and any associated files) is confidential and\...{{dropped}}




More information about the R-help mailing list