applyFlat: Apply a vectorized binary operation recycling over last...

Description Usage Arguments Value Examples

View source: R/GSEA-by-boot.R

Description

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.

Usage

1
applyFlat(x, y, FUN = "-")

Arguments

x

array, order K

y

array, order K-1

FUN

vectorized binary operation

Value

array, order K equal to FUN(x,y)

Examples

1
2
3
4
5
6
##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)

MAST documentation built on Nov. 8, 2020, 8:19 p.m.