toMatrix {receptLoss}R Documentation

Convert SummarizedExperiment or Dataframe to Matrix

Description

This function converts SummarizedExperiment objects and dataframes (both S3 and S4) to matrices of expression values. Used within receptLoss functions to convert all matrix-like objects to the matrix class.

Usage

toMatrix(m, rwnms = NA)

Arguments

m

Can be a matrix, a data.frame, a DataFrame, or SummarizedExperiment object.

rwnms

the rownames of the object. If NA (the default), assumes that the matrix-like object already has rownames, which in this case do not need to be supplied separately.

Value

A matrix of expression values

Examples

m <- as.data.frame(matrix(data=rgamma(n=100, shape=3, rate=2),
nrow=10, ncol=10))
m <- toMatrix(m)

[Package receptLoss version 1.2.0 Index]