Skip to contents

Given a list and an index subset each element of the list and remove the variables that are constant.

Usage

subsetData(A, index)

Arguments

A

A list of an array with samples in rows and variables in the columns.

index

The samples to keep.

Value

A list with the samples.

Note

It also removes constant variables of the data.

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"