View source: R/driveplot_map.R
| driveplot_map | R Documentation |
Create a standalone map
driveplot_map(
shareddata,
lng = NULL,
lat = NULL,
group = NULL,
colorvar = NULL,
label = NA,
colorpalette = NULL,
fillopacity = 1,
mapheight = "100vh",
tileprovider = "Esri.WorldStreetMap"
)
shareddata |
A SharedData object containing observations to be plotted. |
lng |
The bare (unquoted) column of shareddata containing longitude (only required if shareddata does not have a geometry column). |
lat |
The bare (unquoted) column of shareddata containing latitude (only required if shareddata does not have a geometry column). |
group |
The bare (unquoted) column from shareddata for the grouping variable. |
colorvar |
The bare (unquoted) column in shareddata to which color should be mapped. |
label |
An optional label for the map points. |
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 map points (0 to 1). |
mapheight |
The height of the map, e.g, "100vh" or 400px". |
tileprovider |
The name of the provider for the basemap tiles. Options
can be found by running |
A leaflet map.
library(crosstalk)
data(drive7)
shared_drive <- SharedData$new(drive7)
# Basic map of one drive
driveplot_map(shareddata = shared_drive)
# Color drive points by direction of car
driveplot_map(
shareddata = shared_drive,
colorvar = gyro_heading,
label = gyro_heading,
colorpalette = "viridis"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.