This function works differently from other extract_... functions in that it returns a direction list with components dir_x, dir_y, dir_z, not a scalar value, and NULL if the input is invalid.

extract_direction(
  df,
  min_time = min(df$time, na.rm = TRUE),
  max_time = max(df$time, na.rm = TRUE)
)

Arguments

df

Movement data frame. Expects columns pos_x, pos_y, pos_z, time.

min_time

minimum time in s (default trial start)

max_time

maximum time in s (default trial end)