I am running a microarray analysis using limma containing some spike-in controls that allowed me to know that I got a linear signal response with a data$E >= 2.3, where data is a EList class object (data is microarray data already substracted and normalized), and data$E contains the intensity signal
Then, I tried to subset the data
data <- data[data$E >= 2.3]
But I got an error
Error: Two subscripts required
However if I run
> head(data$E >= 2.3) A B C D E F [1,] TRUE TRUE TRUE TRUE TRUE TRUE [2,] TRUE TRUE TRUE TRUE TRUE TRUE [3,] TRUE TRUE TRUE TRUE TRUE TRUE [4,] TRUE TRUE TRUE TRUE TRUE TRUE [5,] TRUE TRUE TRUE TRUE TRUE TRUE [6,] TRUE TRUE TRUE TRUE TRUE TRUE
Any clue on how can I subset the data ?
sorry for not checking my answer... data$E is a matrix and not a vector...
so, exactly what do you want to subset? only rows with all values >= 2.3, e.g.
data[apply(data$E, 1, function(x) all(x >= 2.3)), ]
should do that; and there is package genefilter for more complicated things.
Or, more elegantly and quickly:
... and so on, for any number of values that you'd like to be greater-than-or-equal-to 2.3 per row.