Given a list and an index subset each element of the list and remove the variables that are constant.
Arguments
- A
A list of an array with samples in rows and variables in the columns.
- index
The samples to keep.
Examples
data(ge_cgh_locIGR)
A <- subsetData(ge_cgh_locIGR$multiblocks, sample(53, replace = TRUE))
str(A)
#> List of 3
#> $ GE : num [1:53, 1:15702] 0.647 -1.679 1.258 -0.273 -0.163 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:53] "1" "2" "3" "4" ...
#> .. ..$ : chr [1:15702] "A_23_P212522" "A_32_P30710" "A_24_P470079" "A_23_P65830" ...
#> $ CGH: num [1:53, 1:1229] 0.00649 0.00636 -0.26816 -0.00226 0.03366 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:53] "1" "2" "3" "4" ...
#> .. ..$ : chr [1:1229] "1" "3" "5" "6" ...
#> $ y : num [1:53, 1:3] 1 1 0 0 1 1 0 1 0 1 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:53] "1" "2" "3" "4" ...
#> .. ..$ : chr [1:3] "cort" "dipg" "midl"