library(pathviewr)
## 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, isolate, and label trajectories
motive_full <-
motive_data %>%
clean_viewr(desired_percent = 50,
max_frame_gap = "autodetect",
span = 0.95)
##Remove subjects that have not completed at least 150 trajectories:
motive_rm_unmirrored <-
motive_full %>%
rm_by_trajnum(trajnum = 150)
## Add treatment information
motive_full$treatment <- c(rep("latA", 100),
rep("latB", 100),
rep("latA", 100),
rep("latB", 149))
## Remove subjects by that have not completed at least 10 trajectories in
## both treatments
motive_rm_mirrored <-
motive_full %>%
rm_by_trajnum(
trajnum = 10,
mirrored = TRUE,
treatment1 = "latA",
treatment2 = "latB"
)
Run the code above in your browser using DataLab