[R] Filtering a data frame using a string for colum header

2009-02-22 Thread Tony Breyal
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[

Re: [R] Filtering a data frame using a string for colum header

2009-02-22 Thread Chun-Hao Tu
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

Re: [R] Filtering a data frame using a string for colum header

2009-02-22 Thread Petr PIKAL
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

Re: [R] Filtering a data frame using a string for colum header

2009-02-23 Thread Prof Brian Ripley
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

Re: [R] Filtering a data frame using a string for colum header

2009-02-23 Thread Tony Breyal
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