remove_vel_anomalies: Remove any rows which show sharp shifts in velocity that are...

View source: R/utility_functions.R

remove_vel_anomaliesR Documentation

Remove any rows which show sharp shifts in velocity that are likely due to tracking errors

Description

Remove any rows which show sharp shifts in velocity that are likely due to tracking errors

Usage

remove_vel_anomalies(
  obj_name,
  target = "velocity",
  method = "gesd",
  alpha = 0.05,
  max_anoms = 0.2
)

Arguments

obj_name

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

target

The column to target; defaults to "velocity"

method

The anomaly detection method; see anomalize::anomalize()

alpha

The width of the "normal" range; see anomalize::anomalize()

max_anoms

The max proportion of anomalies; see anomalize::anomalize()

Details

This function runs anomalize::anomalize() on a per-trajectory basis. The separate_trajectories() and get_full_trajectories() must be run prior to use.

Value

A viewr object (tibble or data.frame with attribute pathviewr_steps. Rows in which large anomalies were detected have been removed. No additional columns are created.

Author(s)

Vikram B. Baliga

See Also

Other utility functions: clean_by_span(), insert_treatments(), remove_duplicate_frames(), set_traj_frametime()


vbaliga/pathviewR documentation built on March 16, 2023, 4:13 p.m.