awipe: Generalized array's sweep() for data cleaning.

Description Usage Arguments Examples

Description

Return a generalized array, by wiping out a summary statistic.

Usage

1
2
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, areduce(sum, X) is the same as sum(X).

MoreArgs, SIMPLIFY, VECTORIZED

Argument used by 'amap()'.

...

Argument used by 'areduce()'.

Examples

1
2
3
4
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")

garray documentation built on May 1, 2019, 8:47 p.m.