min_time and max_time.R/extract_movement_functions.R
extract_orientation2.RdYou can supply timestamps to min_time and max_time (e.g timestamp of
begin escape) to average over only a period.
extract_orientation2(
ref_movement,
target_movement,
min_time = 0,
max_time = Inf,
convert2cos = TRUE,
...
)A reference movement data frame, e.g. the head or
the waist movement. Movement file should have pos_x, pos_y, pos_z,
rot_x, rot_y, rot_z columns.
Data frame of reference movement (e.g threat movement)
minimum time in s (default trial start)
maximum time in s (default trial end)
Whether to use the cosine of the angle (TRUE, default) or the absolute angle (FALSE)
any other arguments to be passed on to add_orientation2target2
An average of the target_ratio or absolute target difference over
time between min_time and max_time. Uses trapezium rule for average over
variable sample rate.
sample_movement <- example_data$head_movement_data_0[[1]]
threat_movement <- example_data$threat_movement_data_0[[1]]
extract_orientation2(sample_movement, threat_movement)
#> [1] 0.641063