event: Identify events

Description Usage Arguments Value Author(s) See Also Examples

Description

Finds the first and last location of an event

Usage

1
event(x, clip = "none", na.rm = FALSE, nas = FALSE, duration = NULL)

Arguments

x

A logical statement in which the output is TRUE or FALSE

clip

Defaults to "none", If set to "buffer" a false if placed on each end of the string,if set to TRUE the data is clipped to the first and last time when the event did not occur

na.rm

TRUE/FALSE should NAs be handled

nas

if na.rm is set to true, what should NAs be replaced with TRUE/FALSE

duration

Numeric number selecting the minimum duration of an event

Value

Returns a matix of two columns

start

the location in the original vector at which the event starts

end

the location in the original vector at which the event stops

Author(s)

Connor F. White

See Also

eventInterp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x<-c(.5,.5,.75,.25,.2,.25,.6,.9,.1,.7)
x.e<-event(x<.3)

#Excluding the .1 where there is only 1 value below .3
x.e<-event(x<.3,duration=1)


#If we were interested in values greater than .3 we would need
# to alter the data as the the first and last values are true.

#Starts searching for events from the first time a FALSE occurs
x.e<-event(x>.3,clip=TRUE)

#Starts searching for events from the very beginning
x.e<-event(x>.3,clip="buffer")

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