rescale_matrix {bulkAnalyseR}R Documentation

Rescale a matrix

Description

This function rescales the rows of a matrix according to the specified type.

Usage

rescale_matrix(
  mat,
  type = c("Expression", "Log2 Expression", "Mean Scaled", "Z-score")
)

Arguments

mat

the matrix to rescale

type

type of rescaling; one of "Expression" (defautl, does nothing), "Log2 Expression" (returns log2(x + 1) for every value), "Mean Scaled" (each row is scaled by its average), "Z-score" (each row is centered and scaled to mean = 0 and sd = 1)

Value

The rescaled matrix.

Examples

mat = matrix(1:10, nrow = 2, ncol = 5)
rescale_matrix(mat, type = "Expression")
rescale_matrix(mat, type = "Log2 Expression")
rescale_matrix(mat, type = "Mean Scaled")
rescale_matrix(mat, type = "Z-score")

[Package bulkAnalyseR version 1.1.0 Index]