View source: R/extract_windows.R
extract_windows | R Documentation |
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"
extract_windows(df, ur, window_start, window_end)
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) |
Retruns a data frame of all sample windows.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.