Bill Dunlap <[EMAIL PROTECTED]> writes:
> On Wed, 23 Feb 2006, Peter Dalgaard wrote:
>
> > "Gabor Grothendieck" <[EMAIL PROTECTED]> writes:
> >
> > > Try this:
> > >
> > > subset(iris, select = - Species)
> >
> > Or, canonically,
> >
> > nm <- names(iris)
> > iris[, nm != "Species" ]
> >
> > iri
One thing I notice is that after using subset() on a data frame
imported from SPSS, my variable.names attribute disappeared. I guess
what I would expect is for a subset() method always to preserve
everything but the omitted column.
Cheers
David
On 27/02/06, Bill Dunlap <[EMAIL PROTECTED]> wrote:
On Wed, 23 Feb 2006, Peter Dalgaard wrote:
> "Gabor Grothendieck" <[EMAIL PROTECTED]> writes:
>
> > Try this:
> >
> > subset(iris, select = - Species)
>
> Or, canonically,
>
> nm <- names(iris)
> iris[, nm != "Species" ]
>
> iris[, -match("Species", nm)]
>
> >
> > On 2/22/06, [EMAIL PROTECTED] <[
"Gabor Grothendieck" <[EMAIL PROTECTED]> writes:
> Try this:
>
> subset(iris, select = - Species)
Or, canonically,
nm <- names(iris)
iris[, nm != "Species" ]
iris[, -match("Species", nm)]
>
> On 2/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > I agree with the submitter that this
Try this:
subset(iris, select = - Species)
On 2/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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
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 l