I would have used
1) != rather than ! ... ==
2) !(names(my.df) %in% DrHorrible) since that handles NA names
(possible, but not easy to get) better.
and note that
3) subset(my.df, select = -DrHorrible) works.
On Mon, 23 Feb 2009, Petr PIKAL wrote:
Hi
r-help-boun...@r-project.org napsal
Cheers guys,
yeah, I was using this bit of code as my work around:
filter.col - which(names(my.df)!=DrHorrible)
my.df[filter.col]
but you guys had better solutions :-)
Is there an R wish list somewhere? I tried google but couldn't find a
specific location, just various threads here and
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)
Hi Tony,
I GUESS my.df[-DrHorrible] does not tell R which column NUMBER would like
to remove.
As we know, we could use my.df[-4] and it exactly tells R which column must
remvoer from your data.
my.df[-4]
Angel Buffy Firefly
1 7 8 9
2 8 9 9
3 6 4 10
Hi
r-help-boun...@r-project.org napsal dne 23.02.2009 03:44:41:
Hi Tony,
I GUESS my.df[-DrHorrible] does not tell R which column NUMBER
would
like to remove.
As we know, we could use my.df[-4] and it exactly tells R which column
must
remvoer from your data.
my.df[-4]
Angel
5 matches
Mail list logo