View source: R/ggMap_IndivTrajectories.R
| ggMap_IndivTrajectories | R Documentation |
Function to plot trajectories from a DisMELS model run by start zone.
ggMap_IndivTrajectories(
sf_trjs,
colorBy = "successful",
colorLabel = colorBy,
subtitle = "",
bmls,
startZones = 1:8,
nSZpG = 1,
nPlotCols = 4,
colours = c("red", "cyan", "green", "blue", "black")
)
sf_trjs |
- sf dataframe from |
colorBy |
- name of column to use as levels to color tracks by |
colorLabel |
- label for colours legend |
subtitle |
- plot subtitle |
bmls |
- basemap layers object (e.g., from |
startZones |
- vector of valid start zones |
nSZpG |
- number of start zones per map group (1 map is plotted per group) |
nPlotCols |
- number of columns of maps per page |
colours |
- vector of colours to use for trajectories |
Separate maps are created for each group of start zones (in column "startZone"),
then arranged using facet_wrap. The total number of maps per page
will be the number of startZones/nSZpG, arranged into nPlotCols columns.
The colour values in colours will be truncated or repeated to match
the number of distinct levels in the column specified by colorBy. It is
probably best if this column is a factor, with the expectation that factor levels
map to colours by index into the truncated/expanded colours.
ggplot2 object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.