Re: [R] subset question

2010-12-29 Thread Sarah Goslee
Details of *what* didn't work would be helpful, like for example error messages. Regardless, I'd do it like this: subd <- d[, d$gene %in% c("i1","i2","i3"), ] > d gene 1 2 3 1 i1 1 6 11 2 i5 2 7 12 3 i2 3 8 13 4 i3 4 9 14 5 i1 5 10 15 > d[d$gene %in% c("i1","i2","i3"), ] g

Re: [R] subset question

2010-12-29 Thread Jorge Ivan Velez
Hi Anjan, Try subset(d, gene %in% c("i1", "i2", "i3")) HTH, Jorge On Wed, Dec 29, 2010 at 4:55 PM, ANJAN PURKAYASTHA <> wrote: > Hi, > I'm having a problem with a step that should be pretty simple. > I have a dataframe, d, with column names : gene s1 s2 s3. The column > "gene" > stores an Id

Re: [R] subset question

2010-12-29 Thread ANJAN PURKAYASTHA
nope, that did not work. thanks though. Anjan On Wed, Dec 29, 2010 at 5:02 PM, Jonathan Flowers < jonathanmflow...@gmail.com> wrote: > Try subd <- d[, "gene" == c("i1","i2","i3")] > > On Wed, Dec 29, 2010 at 4:55 PM, ANJAN PURKAYASTHA < > anjan.purkayas...@gmail.com> wrote: > >> Hi, >> I'm having

Re: [R] subset question

2010-12-29 Thread Jonathan Flowers
Try subd <- d[, "gene" == c("i1","i2","i3")] On Wed, Dec 29, 2010 at 4:55 PM, ANJAN PURKAYASTHA < anjan.purkayas...@gmail.com> wrote: > Hi, > I'm having a problem with a step that should be pretty simple. > I have a dataframe, d, with column names : gene s1 s2 s3. The column > "gene" > stores an

[R] subset question

2010-12-29 Thread ANJAN PURKAYASTHA
Hi, I'm having a problem with a step that should be pretty simple. I have a dataframe, d, with column names : gene s1 s2 s3. The column "gene" stores an Id; the rest of the columns store intensity data. I would like to extract the rows for gene Ids i1, i2, i3 ( I know a priori that those rows exis

Re: [R] Subset Question

2010-02-25 Thread Chertudi
Thank you Eric and Petr. It seems to be working now! -- View this message in context: http://n4.nabble.com/Subset-Question-tp1568555p1569461.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

Re: [R] Subset Question

2010-02-25 Thread Chertudi
Thank you Eric and Petr. It seems to be working now! -- View this message in context: http://n4.nabble.com/Subset-Question-tp1568555p1569464.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

Re: [R] Subset Question

2010-02-25 Thread Erik Iverson
Chertudi wrote: Hello helpful R folks, First off, please forgive my English. Second, I'm new with R, I've searched the archives about subsets, and I haven't found quite the help I need. I'm currently analysing a population survey whose data set has about 15000 households (the rows/observati

[R] Subset Question

2010-02-24 Thread Chertudi
Hello helpful R folks, First off, please forgive my English. Second, I'm new with R, I've searched the archives about subsets, and I haven't found quite the help I need. I'm currently analysing a population survey whose data set has about 15000 households (the rows/observations) and 130 vari