Hi all,
I was just radomly playing with R and got the following error when
trying to filter a data frame using a string:
> Angel <- c(7,8,6,9,10)
> Buffy <- c(8,9,4,9,10)
> Firefly <- c(9,9,10,10,10)
> DrHorrible <- c(10,9,9,10,10)
> my.df <- data.frame(Angel, Buffy, Firefly, DrHorrible)
> my.df[
8 9 9
3 6 4 10
4 9 9 10
51010 10
I may be not right.
Chunhao
> Date: Sun, 22 Feb 2009 14:48:10 -0800
> From: tony.bre...@googlemail.com
> To: r-help@r-project.org
> Subject: [R] Filtering a data frame using a string
Regards
Petr
>
>
>
> Chunhao
>
>
>
>
>
>
>
>
> > Date: Sun, 22 Feb 2009 14:48:10 -0800
> > From: tony.bre...@googlemail.com
> > To: r-help@r-project.org
> > Subject: [R] Filtering a data frame using a string for colum header
> >
&g
within selection operator [...].
If you know the name and you do not want column with this particular name
use
my.df[,!names(my.df)==("DrHorrible")]
Regards
Petr
Chunhao
Date: Sun, 22 Feb 2009 14:48:10 -0800
From: tony.bre...@googlemail.com
To: r-help@r-project.org
Subjec
uot;DrHorrible" : invalid argument to unary operator, so the error
> > is within selection operator [...].
>
> > If you know the name and you do not want column with this particular name
> > use
>
> > my.df[,!names(my.df)==("DrHorrible")]
>
> &g
5 matches
Mail list logo