plot_viewr_trajectories: Plot each trajectory within a viewr object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotting_functions.R

Description

Plot each trajectory within a viewr object

Usage

1
2
3
4
5
plot_viewr_trajectories(
  obj_name,
  plot_axes = c("length", "width"),
  multi_plot = FALSE
)

Arguments

obj_name

A viewr object (a tibble or data.frame with attribute pathviewr_steps that includes "viewr") that has been passed through separate_trajectories() or get_full_trajectories().

plot_axes

Which position axes should be plotted? A character vector including exactly two of the following choices must be supplied: length, width, height. Default is c("length", "width").

multi_plot

Should separate plots (one per trajectory) be created or should one multi-plot grid be generated. Defaults to FALSE, which produces separate plots.

Value

A (base-R) series of plots or single plot (if multi_plot = TRUE) that depict each trajectory along the chosen axes.

Author(s)

Vikram B. Baliga

See Also

Other plotting functions: plot_by_subject(), visualize_frame_gap_choice()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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'))

motive_full <-
  motive_data %>%
  clean_viewr(desired_percent = 50,
              max_frame_gap = "autodetect",
              span = 0.95)

plot_viewr_trajectories(motive_full, multi_plot = FALSE)
plot_viewr_trajectories(motive_full, multi_plot = TRUE)

pathviewr documentation built on May 6, 2021, 9:07 a.m.