min_time and max_time.R/extract_movement_functions.R
extract_orientation.RdYou can supply timestamps to min_time and max_time (e.g timestamp of
begin escape) to average over only a period.
extract_orientation(
ref_movement,
target_position,
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.
A list with pos_x, pos_y, and pos_z coordinates of the target
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_orientation2target()
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]]
pos_list <- list(pos_x = 2, pos_y=1, pos_z=2)
extract_orientation(sample_movement, pos_list)
#> [1] 0.02227791