myapply: myapply function

Description Usage Arguments Value Examples

View source: R/JiangZhihangToolsHW&QUIZ2_Rfunctions.R

Description

it is similar with apply function

Usage

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

Arguments

x

an array

MARGIN

a vector giving the subscripts which the function will be applied over.

FUN

functions to be applied

...

optional arguments to FUN

Value

array

Examples

1
2
3
4
fred=matrix(1:6,nrow = 3)
rownames(fred)=c("red","white","blue")
colnames(fred)=c("car","truck")
myapply(fred, 1, mean)

ZJ107/JiangZhihangTools documentation built on May 25, 2019, 2:23 p.m.