sweepR Documentation

Sweep out Array Summaries

Description

Return an array obtained from an input array by sweeping out a summary statistic.

Usage

## S4 method for signature 'fm'
sweep(x, MARGIN, STATS, FUN = "-", check.margin = TRUE, ...)

Arguments

x

a FlashR matrix.

MARGIN

an integer giving the extent of x which correspond to STATS.

STATS

the summary statistic which is to be swept out.

FUN

the function to be used to carry out the sweep.

check.margin

logical. It's ignored right now.

...

optional arguments to FUN.

Value

A matrix with the same shape as x, but with the summary statistics swept out.

Examples

mat <- fm.runif.matrix(100, 10)
sweep(mat, 1, runif(100))