From p.dalgaard at biostat.ku.dk  Thu Feb 23 00:23:59 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 23 Feb 2006 00:23:59 +0100
Subject: [Rd] PR#6614
In-Reply-To: <971536df0602221113g18fa674doa0deb0febae49bd9@mail.gmail.com>
References: <20060222184741.5EFB93F705@slim.kubism.ku.dk>
	<971536df0602221113g18fa674doa0deb0febae49bd9@mail.gmail.com>
Message-ID: <x2fymbrn8w.fsf@turmalin.kubism.ku.dk>

"Gabor Grothendieck" <ggrothendieck at 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 at gmail.com <davidhughjones at 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 at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> 
> ______________________________________________
> R-devel at 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 at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] PR#6614
Peter Dalgaard