get_traj_velocities: Recompute trajectory-specific velocities

View source: R/analytical_functions.R

get_traj_velocitiesR Documentation

Recompute trajectory-specific velocities

Description

Recompute trajectory-specific velocities

Usage

get_traj_velocities(
  obj_name,
  time_col = "time_sec",
  length_col = "position_length",
  width_col = "position_width",
  height_col = "position_height",
  set_init_vel_zero = FALSE,
  velocity_min = NA,
  velocity_max = NA
)

Arguments

obj_name

The input viewr object; a tibble or data.frame with attribute pathviewr_steps that includes "viewr"

time_col

Name of the column containing time

length_col

Name of the column containing length dimension

width_col

Name of the column containing width dimension

height_col

Name of the column containing height dimension

set_init_vel_zero

Should the first value be zero or can it be a duplicate of the second velocity value? Defaults to FALSE.

velocity_min

Should data below a certain velocity be filtered out of the object? If so, enter a numeric. If not, keep NA.

velocity_max

Should data above a certain velocity be filtered out of the object? If so, enter a numeric. If not, keep NA.

Details

Instantaneous velocity is not truly "instantaneous" but rather is approximated as the change in distance divided by change in time from one observation (row) to the previous observation (row). Each component of velocity is computed (i.e. per axis) along with the overall velocity of the subject.

Value

If add_to_viewr is TRUE, additional columns are appended to the input viewr object. If FALSE, a standalone tibble is created. Either way, an "instantaneous" velocity is computed as the difference in position divided by the difference in time as each successive row is encountered. Additionally, velocities along each of the three position axes are computed and provided as additional columns.

Author(s)

Vikram B. Baliga

See Also

Other mathematical functions: calc_min_dist_v(), deg_2_rad(), find_curve_elbow(), get_2d_angle(), get_3d_angle(), get_3d_cross_prod(), get_dist_point_line(), get_velocity(), rad_2_deg()


pathviewr documentation built on March 31, 2023, 5:47 p.m.