toMatrix: Convert SummarizedExperiment or Dataframe to Matrix

Description Usage Arguments Value Examples

View source: R/scripts.R

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

1
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

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

dpique/receptLoss documentation built on April 27, 2020, 3:21 a.m.