[R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Bastien Ferland-Raymond
DearR Users, I have a problem which I think you might be able to help. I have a dataframe which I'm trying to filter following different groups I specified. It's a little hard to explain, so here is an example: My dataframe: ESS DHP 1 EPB 22 2 SAB 10 3 SAB 20 4 BOJ 14 5 ERS 28

Re: [R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Ista Zahn
Hi Bastien, You can use match(), or the convenience function %in%, like this (assuming your data.frame is named dat): subset(dat, ESS %in% c(EPB,SAB)) dat[dat$ESS %in% c(EPB,SAB), ] best, Ista On Fri, Sep 17, 2010 at 1:02 PM, Bastien Ferland-Raymond bastien.ferland-raymon...@ulaval.ca wrote:

Re: [R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Phil Spector
Bastien - In what way did subset(yourdataframe,ESS %in% softwood) not work? - Phil Spector Statistical Computing Facility Department of Statistics