momentary_time_recording: Applies momentary time recording to a behavior stream

Description Usage Arguments Value Examples

View source: R/observation_method_filters.R

Description

Evaluates the presence or absence of the behavior at fixed moments in time.

Usage

1
momentary_time_recording(BS, interval_length, summarize = TRUE)

Arguments

BS

object of class behavior_stream

interval_length

length of interval between moments.

summarize

logical value indicating whether vector of moments should be summarized by taking their mean.

Value

If summarize = FALSE, a matrix with length n_intervals + 1 and width equal to the number of behavior streams in BS. If summarize = TRUE, a vector of proportions of length equal to the number of behavior streams in BS. Note that if summarize = TRUE, the initial state of the behavior stream is excluded when calculating the mean, so the proportion is based on n_intervals values.

Examples

1
2
3
4
5
BS <- r_behavior_stream(n = 5, mu = 3, lambda = 10, 
                       F_event = F_exp(), F_interim = F_exp(), stream_length = 100)
momentary_time_recording(BS, interval_length = 20, FALSE)
momentary_time_recording(BS, interval_length = 20)
colMeans(momentary_time_recording(BS, 20, FALSE)[-1,])

ARPobservation documentation built on May 1, 2021, 1:08 a.m.