momentary_time_recording {ARPobservation}R Documentation

Applies momentary time recording to a behavior stream

Description

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

Usage

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

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,])

[Package ARPobservation version 1.2.2 Index]