ap_sb_gr_duration_calculator: Calculate the duration of a behaviour with a partner.

View source: R/ap_sb_gr_duration_calculator.R

ap_sb_gr_duration_calculatorR Documentation

Calculate the duration of a behaviour with a partner.

Description

Written specifically for approach, body contact and grooming.

Usage

ap_sb_gr_duration_calculator(d_focal, start_codes, end_codes, focals,
  partners)

Arguments

d_focal

data frame of focal observations. Currently needs all these columns with exact same names: "date", "protocol_start_time", "focal_animal", "observer", "action_time", "actor", "action", "receiver", "action_partner", "action_time_of_day_sec"

start_codes

a character vector of action codes that indicate when a behaviour starts.

end_codes

a character vector of action codes that indicate when a behaviour ends.

focals

a character vector of focal animals

partners

a character vector of partners which took part in the behaviour.

Value

adds two columns to d_focal. One with the total duration in seconds (duration_s), and another with the total duration in hh:mm:ss (duration)


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