float (version 0.2-3)

sweep: sweep

Description

Sweep a vector through a float matrix.

Usage

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

Arguments

x

A float vector/matrix.

MARGIN

1 (rows) or 2 (columns)

STATS

Vector to sweep out.

FUN

Sweeping function; must be one of "+", "-", "*", or "/".

check.margin

Should x/STATS margin lengths be checked?

...

Theoretically these are additional arguments passed to an arbitrary function. However, we only support basic arithmetic, so they are ignored.

Value

A matrix of the same type as the highest precision input.

Details

Note that if the length of STATS does not recycle exactly across MARGIN, the results here will differ slightly from the results of base R.

Examples

Run this code
# NOT RUN {
library(float)

s = flrunif(10, 3)
sweep(s, 2, fl(1))

# }

Run the code above in your browser using DataCamp Workspace