Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subsetting

Subset RGList, MAList, EListRaw, EList, MArrayLM or TestResults Objects


Description

Return an RGList, MAList, EListRaw, EList, MArrayLM or TestResults object with only selected rows and columns of the original object.

Usage

## S3 method for class 'EList'
object[i, j, ...]
subsetListOfArrays(object, i, j, IJ, IX, I, JX)

Arguments

object

object of class RGList, MAList, EListRaw, EList, MArrayLM or TestResults.

i,j

elements to extract. i subsets the probes or spots while j subsets the arrays.

IJ

character vector giving names of components that should be subsetted by i and j.

IX

character vector giving names of 2-dimensional components that should be subsetted by i only.

I

character vector giving names of vector components that should be subsetted by i.

JX

character vector giving names of 2-dimensional components whose row dimension corresponds to j.

...

other arguments are not currently used.

Details

All these objects can be subsetted as if they were matrices. i,j may take any values acceptable for the matrix components of object. Either or both can be missing. See the Extract help entry for more details on subsetting matrices.

object[] will return the whole object unchanged. A single index object[i] will be taken to subset rows, so object[i] and object[i,] are equivalent.

subsetListOfArrays is used internally as a utility function by the subsetting operations. It is not intended to be called directly by users. Values must be supplied for all arguments other than i and j.

Value

An object the same as object but containing data from the specified subset of rows and columns only.

Note the output object is of the same class as object will have two dimensions attached even if i or j select a single row or column, i.e., subsetting for these objects does not drop dimensions. Subsetting is exactly analogous to subsetting of matrices in R with drop=FALSE.

Author(s)

Gordon Smyth

See Also

Extract in the base package.

02.Classes for a summary of the different data classes.

Examples

M <- A <- matrix(11:14,4,2)
rownames(M) <- rownames(A) <- c("a","b","c","d")
colnames(M) <- colnames(A) <- c("A","B")
MA <- new("MAList",list(M=M,A=A))
MA[1:2,]
MA[c("a","b"),]
MA[1:2,2]
MA[,2]

limma

Linear Models for Microarray Data

v3.46.0
GPL (>=2)
Authors
Gordon Smyth [cre,aut], Yifang Hu [ctb], Matthew Ritchie [ctb], Jeremy Silver [ctb], James Wettenhall [ctb], Davis McCarthy [ctb], Di Wu [ctb], Wei Shi [ctb], Belinda Phipson [ctb], Aaron Lun [ctb], Natalie Thorne [ctb], Alicia Oshlack [ctb], Carolyn de Graaf [ctb], Yunshun Chen [ctb], Mette Langaas [ctb], Egil Ferkingstad [ctb], Marcus Davy [ctb], Francois Pepin [ctb], Dongseok Choi [ctb]
Initial release
2020-10-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.