Re: [Rd] PR#6614

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 22 Feb 2006 - 23:23:59 GMT

"Gabor Grothendieck" <ggrothendieck@gmail.com> writes:

> Try this:
>
> subset(iris, select = - Species)

Or, canonically,

nm <- names(iris)
iris[, nm != "Species" ]

iris[, -match("Species", nm)]  

>
> On 2/22/06, davidhughjones@gmail.com <davidhughjones@gmail.com> wrote:
> > I agree with the submitter that this needs some kind of solution.
> > Although data.frame[,-12] works, how do I drop a named column (the
> > most common use case)? (I found this bug while searching for an
> > answer.)
> >
> > cheers
> > David
> >
> > ______________________________________________
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
   O__  ---- Peter Dalgaard             Ĝster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Feb 23 10:26:13 2006

This archive was generated by hypermail 2.1.8 : Mon 27 Feb 2006 - 19:16:13 GMT