Description Usage Arguments Value Author(s) See Also Examples
Finds the first and last location of an event
1 |
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 |
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 |
Connor F. White
eventInterp
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.