Skip to contents

Plot a report of trajectory motifs

Usage

plot_traj_model_report(
  traj_model,
  filename = NULL,
  motif_num = NULL,
  free_coef_axis = TRUE,
  spatial_freqs = NULL,
  width = NULL,
  height = NULL,
  dev = grDevices::pdf,
  title = NULL,
  motif_titles = NULL,
  sort_motifs = TRUE,
  names_map = NULL,
  boxp_ylim = c(-0.5, 0.5),
  ...
)

Arguments

traj_model

Trajectory model object. Please run regress_trajectory_motifs first.

filename

Filename to save the plot to. If NULL, the plot will be returned.

motif_num

Number of motifs to plot. If NULL, all motifs will be plotted.

free_coef_axis

Whether to use a free axis for the coefficient plots.

spatial_freqs

Pre-computed spatial frequencies to plot. Use compute_traj_model_spatial_freq to compute.

width

Width of the plot.

height

Height of the plot.

dev

Device to use for saving the plot. Default: grDevices::pdf.

title

Title of the plot.

motif_titles

Titles for the motifs. If NULL, the motif names will be used.

sort_motifs

Whether to sort the motifs by the absolute value of the coefficients / r2 values.

names_map

a named vector to map the names of the motifs to new names.

boxp_ylim

ylimits for the boxplot of energy vs response.

...

Additional arguments to pass to the device.

Value

ggplot2 object. If filename is not NULL, the plot will be saved to the file and the function will return invisible(NULL).