awipe {garray} | R Documentation |
Generalized array's sweep() for data cleaning.
Description
Return a generalized array, by wiping out a summary statistic.
Usage
awipe(X, FUN = "-", STATS = "mean", MARGIN = NULL, MoreArgs = NULL,
..., SIMPLIFY = TRUE, VECTORIZED = NA)
Arguments
X |
A generalized array. |
FUN |
The wiping function. |
STATS |
Numeric array or function. |
MARGIN |
NULL - STATS is an array; character - STATS is a function,
and by X being reduced along MARGIN, X is wiped. Length 0 character
vector means reducing along no margin, resulting in a scalar (in
this case, for example, |
MoreArgs , SIMPLIFY , VECTORIZED |
Argument used by 'amap()'. |
... |
Argument used by 'areduce()'. |
Examples
a <- garray(1:24, c(4,6), list(X=LETTERS[1:4], Y=letters[1:6]),
sdim=list(XX=c(x1=3,x2=1), YY=c(y1=1,y2=2)))
m1 <- awipe(a, MARGIN="XX")
m2 <- awipe(a, `-`, mean, "XX")
[Package garray version 1.1.2 Index]