plot_tracks_sparklines: Plot sparklines for several track variables.

Description Usage Arguments Value Examples

View source: R/tracks_plots.R

Description

Plot sparklines for several track variables.

Usage

1
2
3
plot_tracks_sparklines(tracks, trial, start = NULL, end = NULL,
  vars = NULL, point_events = NULL, window = 600, quantiles = c(0.025,
  0.975))

Arguments

tracks

A tracks object.

trial

A character vector indicating from which trial to plot.

start

Start of section to plot (either in frames or time).

end

End of section to plot (either in frames or time).

vars

A character vector indicating which variables get a sparkline. They will be looked for in the $tr and $pairs tables. Optional. When not given, will plot all variables available.

point_events

An optional vector of point events to highlight with vertical dotted lines (either frame numbers or times).

window

The time that should be plotted around the events, i.e. total size of the window.

quantiles

A vector of length two with the probabilities to be used for the shade grey quantile boxes.

If frames is left NULL, but point_events and window are provided then a window around the point_events.

Value

A ggplot object.

Examples

1
2
3
4
5
Guppies <- guppies %>%
  as_tracks(30, 1080) %>%
  mutate(sp = speed(), acc = acceleration(), turn = angular_velocity())

plot_tracks_sparklines(Guppies, 'a', point_events = 12000)

Ax3man/trackr documentation built on Oct. 8, 2019, 10:53 p.m.