ggMap_IndivTrajectories: Plot trajectories from a DisMELS model run by start zone

View source: R/ggMap_IndivTrajectories.R

ggMap_IndivTrajectoriesR Documentation

Plot trajectories from a DisMELS model run by start zone

Description

Function to plot trajectories from a DisMELS model run by start zone.

Usage

ggMap_IndivTrajectories(
  sf_trjs,
  colorBy = "successful",
  colorLabel = colorBy,
  subtitle = "",
  bmls,
  startZones = 1:8,
  nSZpG = 1,
  nPlotCols = 4,
  colours = c("red", "cyan", "green", "blue", "black")
)

Arguments

sf_trjs

- sf dataframe from indivsInfo_ExtractTrajectories

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 getBasemapLayers)

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

Details

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.

Value

ggplot2 object


wStockhausen/rDisMELS documentation built on March 27, 2022, 1 a.m.