extract_windows: Function to extract sample windows

View source: R/extract_windows.R

extract_windowsR Documentation

Function to extract sample windows

Description

For each sample, a subset data frame is created with all behaviours that occurred between window_start and window_end. Adds a column called "sample_ref", which identifies which sample the window belongs to. Then stacks all sample windows on top of each other into one big data frame.

Currently needs these columns with exact names: "action_time_of_day_sec", "focal_animal", "date"

Usage

extract_windows(df, ur, window_start, window_end)

Arguments

df

Data frame of focal observations

ur

Vector of urine sample numbers

window_start

Start of window relative to time of urine collection (in seconds)

window_end

End of window relative to time of urine collection (in seconds)

Value

Retruns a data frame of all sample windows.


avrincon/phdfuns documentation built on Nov. 13, 2022, 10:34 a.m.