plott.Rd
Plot time series in a single or multi-paneled figure. This is useful, for example, for comparing measurements across different sensors in an animaltag data object. The time axis is automatically displayed in seconds, minutes, hours, or days according to the span of the data.
plott( X, fsx = NULL, r = FALSE, offset = 0, date_time_axis = FALSE, recording_start = NULL, panel_heights = rep.int(1, length(X)), panel_labels = names(X), line_colors, interactive = FALSE, par_opts, ... )
X | List whose elements are either lists (containing data and metadata) or vectors/matrices of time series data. See details. |
---|---|
fsx | (Optional) A numeric vector whose length matches the number of sensor data streams (list elements) in X. (If shorter, |
r | (Optional) Logical. Should the direction of the y-axis be flipped? Default is FALSE. If |
offset | (Optional) A vector of offsets, in seconds, between the start of each sensor data stream and the start of the first one. For example, if acceleration data collection started and then depth data collection commenced 436 seconds later, then the |
date_time_axis | (Optional) Logical. Should the x-axis units be date-times rather than time-since-start-of-recording? Ignored if |
recording_start | (Optional) The start time of the tag recording as a |
panel_heights | (Optional) A vector of relative or absolute heights for the different panels (one entry for each sensor data stream in |
panel_labels | (Optional) A list of y-axis labels for the panels. Defaults to names(X). |
line_colors | (Optional) A list of colors for lines for multivariate data streams (for example, if a panel plots tri-axial acceleration, it will have three lines -- their line colors will be the first three in this list). May be specified in any specification R understands for colors. Defaults to c("#000000", "#009E73", "#9ad0f3", "#0072B2", "#e79f00", "#D55E00") |
interactive | (Optional) Should an interactive figure (allowing zoom/pan/etc.) be produced? Default is FALSE. Interactive plotting requires the zoom package for its |
par_opts | (Optional) A list of options to be passed to |
... | Additional arguments to be passed to |
A plot of time-series data
If the input data X is an animaltag
object, then all sensor variables in the object will be plotted. To plot only selected sensors from the animaltag
object my_tag
, for example, the input X=list(my_tag$A, my_tag$M) would plot just the accelerometer and magnetometer data. If possible, the plot will have
This is a flexible plotting tool which can be used to display and explore sensor data with different sampling rates on a uniform time grid.
if (FALSE) { HS <- harbor_seal list <- list(depth = HS$P$data, A = HS$A$data) plott(list, HS$P$sampling_rate, r = c(TRUE, FALSE)) }