eventFunc: executes function over events

Description Usage Arguments Value Author(s) See Also Examples

Description

Executes a funtion over every event and returns the output for each event

Usage

1
eventFunc(dat, events, fun=function(x){mean(x,na.rm=TRUE)})

Arguments

dat

the vector that you wish to take values from

event

an output from the event function

fun

a function to execute for each event

Value

returns the output of the suppied funtion for each event

Author(s)

Connor F. White

See Also

events

Examples

1
2
3
4
5
6
7
8
data<-rnorm(100)
on<-rbinom(prob=.3,size=1,n=100)

instances<-event(on==0,clip="buffer")

eventFunc(dat=data,events=instances,fun=function(x){mean(x,na.rm=TRUE)})

eventFunc(dat=data,events=instances,fun=function(x){length(x)})

ConnorFWhite/AssFunc documentation built on May 20, 2019, 4:07 p.m.