Entering edit mode
Jabez Wilson
▴
150
@jabez-wilson-1839
Last seen 10.2 years ago
Dear Bioconductors, I want to do something simple, which I cannot find
the solution to. I have a limma data frame and I want to select a
subset of the data frame based on whether the values in the "G"
channel are > e.g. 5000
As an example I use swirl data
targets <- readTargets("SwirlSample.txt"); RG <-
read.maimages(targets, source="spot")
> head(RG$G)
swirl.1 swirl.2 swirl.3 swirl.4
[1,] 22028.260 19278.770 2727.5600 19930.6500
[2,] 25613.200 21438.960 2787.0330 25426.5800
[3,] 22652.390 20386.470 2419.8810 16225.9500
[4,] 8929.286 6677.619 383.2381 786.9048
[5,] 8746.476 6576.292 901.0000 468.0476
[6,] 37010.080 23769.100 23377.9700 28399.0900
I can select the first 20 lines of the df by
>RG[1:20,]
but I really want to select those lines of the df (and keep the df
format intact) where the "G" value in any column is > a certain figure
(e.g. 5000)
However,
> RG[RG$G>5000,]
Error in `[.RGList`(RG, RG$G > 5000, ) :
(subscript) logical subscript too long
I have no success with subset either:
> subset(RG, RG$G>5000,)
Error: Two subscripts required
> subset(RG$G, RG$G>5000)
Error in subset.matrix(RG$G, RG$G > 5000) :
(subscript) logical subscript too long
Do I need to write a loop to check each column of "G" seperately? Or
is there a simpler solution?
TIA
Jabez
[[alternative HTML version deleted]]