View source: R/driveplot_companions.R
| driveplot_companions | R Documentation |
Make a stack of companion graphs from shared drive data
driveplot_companions(
shareddata,
x,
ys,
colorvar = NULL,
group = NULL,
xlabel = NULL,
ylabels = NULL,
colorpalette = NULL,
fillopacity = 1,
showlegend = TRUE,
legendtitle = NULL,
spacing = 0.05,
plotheight = "100vh"
)
shareddata |
A SharedData object containing observations to be plotted. |
x |
The bare (unquoted) column from shareddata to be plotted on the horizontal axis. |
ys |
A vector or list of bare (unquoted) columns from shareddata to be plotted on the vertical axes of the companion graphs. |
colorvar |
The bare (unquoted) column in shareddata to which color should be mapped. |
group |
The bare (unquoted) column from shareddata for the grouping variable. |
xlabel |
The label for the variable on the horizontal axis. |
ylabels |
A vector or list of labels for the vertical axes of the companion graphs. If provided, it should be the same length as ys. |
colorpalette |
The color palette for the plot; either a single
color (e.g., "red") or one of the viridis color palettes compatible
with leaflet. Run |
fillopacity |
The opacity of the fill of the points (0 to 1). |
showlegend |
Show the plot legend (TRUE) or not (FALSE). |
legendtitle |
The title for the plot legend. |
spacing |
A value between 0 and 1 for the space between the companion graphs. |
plotheight |
The height of the stack of companion graphs, e.g., "100vh" or "400px". |
A stack of plotly scatterplots.
library(crosstalk)
data(drive7)
shared_drive <- SharedData$new(drive7)
# Linked time series of speed, headings (in GPS and gyro), and GPS quality
driveplot_companions(
shareddata = shared_drive,
x = time_cst,
ys = c(speed_mph, gyro_heading, gps_heading),
colorvar = gps_pdop,
xlabel = "Time",
ylabels = c(
"Speed (mph)", "Gyro Heading (degrees)",
"GPS Heading (degrees)"
),
colorpalette = "viridis",
legendtitle = "GPS PDOP"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.