powered by
Sweep a vector through a float matrix.
# S4 method for float32 sweep(x, MARGIN, STATS, FUN = "-", check.margin = TRUE, ...)
A matrix of the same type as the highest precision input.
A float vector/matrix.
1 (rows) or 2 (columns)
Vector to sweep out.
Sweeping function; must be one of "+", "-", "*", or "/".
"+"
"-"
"*"
"/"
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.
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.
STATS
MARGIN
library(float) s = flrunif(10, 3) sweep(s, 2, fl(1))
Run the code above in your browser using DataLab