how to select values greater than x in a table row

r

Solution

Your vector `x` will be a series of `TRUE` and `FALSE` values indicating where, in `golub[1042, gol.fac=="ALL"]` the value is greater than 2.4 but then you use it to index `x <- golub[1042, ]` (i.e. across both factors not just `AML`.

Try this:

golub[1042, gol.fac=="ALL"][x]

Problem

I am new to R and I am trying to learn the language. I have been playing around with the Golub (1999) data contained in the multtest package from Bioconductor. Taking the Golub data as an example, I am trying to select values above 2.4 for the gene "CCND3 Cyclin D3" (found on row 1042) among the "ALL" patients (represented by columns 1 to 27; "AML" patients are represented by columns 28 to 38). This is what I have done: ``` library(multtest); data(golub) gol.fac <- factor(golub.cl,levels=0:1, labels= c("ALL","AML")) x <- golub[1042, gol.fac=="ALL"] > 2.4 golub [1042, x] ``` The result I get is: ``` [1] 2.44562 2.76610 2.59385 1.12058 ``` Why am getting the value "1.12058"? I found that "1.12058" is the last (column 38)expression value in row 1042 which belongs to an AML patient. Can someone tell me the right way to do what I am trying to do? And also explain why I am getting the value of the AML patient?

Original source