20-Sweep | R Documentation |
Sweep an MPCR vector through an MPCR matrix.
## S4 method for signature 'Rcpp_MPCR'
sweep(x,stat,margin,FUN)
x |
An MPCR object. |
stat |
MPCR vector containing the value(s) that should be used in the operation. |
margin |
1 means row; otherwise means column. |
FUN |
Sweeping function; must be one of |
An MPCR matrix of the same type as the highest precision input.
library(MPCR)
x <- as.MPCR(1:20,10,2,"single")
y <- as.MPCR(1:5,precision="double")
sweep_out <- sweep(x, stat=y, margin=1, FUN="+")
MPCR.is.double(sweep_out) #TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.