## Import the example Motive data included in the package
motive_data <-
read_motive_csv(system.file("extdata", "pathviewr_motive_example_data.csv",
package = 'pathviewr'))
## Clean the file. It is generally recommended to clean up to the
## "standarization" step before running get_velocity().
motive_cleaned <-
motive_data %>%
relabel_viewr_axes() %>%
gather_tunnel_data() %>%
trim_tunnel_outliers() %>%
rotate_tunnel()
## Now compute velocity and add as columns
motive_velocity_added <-
motive_cleaned %>%
get_velocity(add_to_viewr = TRUE)
## Or set add_to_viewr to FALSE for a standalone object
motive_velocity_standalone <-
motive_cleaned %>%
get_velocity(add_to_viewr = TRUE)
Run the code above in your browser using DataLab