myapply: myapply

Description Usage Arguments Value Examples

Description

Myapply function just like the function array function(X, MARGIN, FUN, ...)

Usage

1
myapply(X, MARGIN, FUN, ...)

Arguments

X

a matrix of any type a matrix can have (numeric, character, logical, complex)

MARGIN

either (the number) 1 or (the number) 2

FUN

an R function that maps vectors to vectors

Value

array or matrix

Examples

1
2
3
4
fred <- matrix(1:6, ncol = 2)
s = array(rnorm(72),c(3,3,8))
result10 <- myapply(fred,1,"mean")
result10

XINFENG66/3479247293 documentation built on May 25, 2019, 2:23 p.m.