applyFlat | R Documentation |
When x is an array of order K, and y is an array of order K-1, whose dimensions otherwise agree, apply FUN by recycling y as necessary over dimension K of x.
applyFlat(x, y, FUN = "-")
x |
array, order K |
y |
array, order K-1 |
FUN |
vectorized binary operation |
array, order K equal to FUN(x,y)
##Dumb example, could be done with scale(...,scale=FALSE)
x0 = matrix(1:10, nrow=2)
y0 = rowMeans(x0)
dim(y0) = c(1, 2)
x1 = MAST:::applyFlat(x0,y0)
stopifnot(rowMeans(x1)==0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.