| exclude_by_velocity {pathviewr} | R Documentation | 
Remove trajectories entirely, based on velocity thresholds
Description
Remove trajectories from a viewr object that contain instances of velocity known to be spurious.
Usage
exclude_by_velocity(obj_name, vel_min = NULL, vel_max = NULL)
Arguments
obj_name | 
 The input viewr object; a tibble or data.frame with attribute
  | 
vel_min | 
 Default   | 
vel_max | 
 Default   | 
Value
A new viewr object that is identical to the input object but now
excludes any trajectories that contain observations with velocity less than
vel_min (if specified) and/or velocity greater than vel_max
(if specified)
Author(s)
Vikram B. Baliga
Examples
## Import and clean the example Motive data
motive_import_and_clean <-
  import_and_clean_viewr(
    file_name = system.file("extdata", "pathviewr_motive_example_data.csv",
                            package = 'pathviewr'),
    desired_percent = 50,
    max_frame_gap = "autodetect",
    span = 0.95
  )
## See the distribution of velocities
hist(motive_import_and_clean$velocity)
## Let's remove any trajectories that contain
## velocity < 2
motive_vel_filtered <-
  motive_import_and_clean %>%
  exclude_by_velocity(vel_min = 2)
## See how the distribution of velocities has changed
hist(motive_vel_filtered$velocity)
[Package pathviewr version 1.1.7 Index]