Skip to contents

custom_scale

Usage

custom_scale(
  input.matrix,
  sweep.function = "/",
  MARGIN = 1,
  scale.factors = NULL,
  allow.negatives = FALSE
)

Arguments

input.matrix

Matrix class

sweep.function

The function passed to sweep that will be used to sweep out the scale factors. Defaults to '/'.

MARGIN

Whether to apply the function within each biomarker (1) or across all biomarkers in each cell (2).

scale.factors

A vector of scale factors. Expects the same length as the axis chosen in MARGIN or a single value. Passed to the sweep argument STATS

allow.negatives

If FALSE, scaling that introduces negative values will have those values corrected to zero.

Value

normalized matrix

Scroll to top