calcConnectivityMatrix: Calculate a connectivity matrix dataframe from a connectivity...

View source: R/calcConnectivityMatrix.R

calcConnectivityMatrixR Documentation

Calculate a connectivity matrix dataframe from a connectivity results sf dataframe

Description

Function to calculate a connectivity matrix datafarme from a connectivity results dataframe.

Usage

calcConnectivityMatrix(
  sfs_points,
  sf_zones,
  startStage = "Z1",
  endStage = "C1F",
  endStageFac = 2,
  startZones = c(1:8),
  endZones = c(1:18),
  plotStartLocs = FALSE,
  plotEndLocs = FALSE,
  bmls = NULL,
  crs = wtsGIS::get_crs(4326),
  nSZpG = 2,
  nPlotCols = 2,
  colours = c("red", "blue", "green", "cyan", "black")
)

Arguments

sfs_points

- list by life stage of sf dataframes with connectivity results and point locations from a single model run

sf_zones

- sf dataframe with connectivity zone information (polygons)

startStage

- name of start life stage for connectivity matrix

endStage

- name of end life stage for connectivity matrix

endStageFac

- multiplier on apparent number successful (e.g., 2 if sexes were split after starting life stage)

startZones

- vector of starting zone id's (integers) for sf_zones

endZones

- vector of ending zone id's (integers) for sf_zones

plotStartLocs

- flag to plot start locations

plotEndLocs

- flag to plot end locations

bmls

- list of ggplot2 basemap layers

crs

- sf coordinate reference system (crs) for maps

nSZpG

- number of start zones to include in a group for end location maps

nPlotCols

- number of columns for end location maps

colours

- vector of colours to use to distinguish start zones in an end location map

Details

Calculates the connectivity matrices by unique startTime for a model run based on the connectivity zones defined in sf_zones. Optionally, ggplot2-style maps of the starting and ending locations of individuals can be created. End zone locations are colored according to their start zone.

Value

list with elements

  • step3_StartEndZones - dataframe with start/end zones for each individual

  • step3_ConnectivityDataframe - connectivity matrices by unique startTime as a dataframe

  • pStartMap - ggplot2 map of start locations (or NULL)

  • pEndMap - ggplot2 map of end locations (or NULL)


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