calcCM: Calculate a connectivity matrix for one DisMELS model run

Description Usage Arguments Details Value

Description

Function to calculate a connectivity matrix based on one DisMELS model run.

Usage

1
2
3
4
5
6
7
8
calcCM(ibmResTbl = NULL, cellsTbl = NULL,
  lhsTypeInfo = getLifeStageInfo.ATF(),
  spawningZones = c("SpawningArea_300to600m"),
  nurseryZones = c("NurseryArea_000to050m", "NurseryArea_050to150m"),
  where_clause = "", writeCSVs = FALSE,
  outNumRel = "NumbersReleasedFromSpawningAreas.csv",
  outConn = "ConnectivityToNurseryAreasFromSpawningAreas.csv",
  outIndivs = "IndivStartEndPositions.csv")

Arguments

ibmResTbl

- name of DisMELS connectivity results file or resulting dataframe (can be NULL)

cellsTbl

- name of classified grid cells file or resulting dataframe (can be NULL)

lhsTypeInfo

- list object with life stage info

spawningZones

- vector of names of zones used as spawning areas in the IBM

nurseryZones

- vector of names of zones used as nursery areas in the IBM

where_clause

- sql "where" clause to determine final state for individuals included in connectivity calculations

writeCSVs

- flag (T/F) to write output files

outNumRel

- csv filename for initial numbers released from spawning areas

outConn

- csv filename for connectivity to nursery areas from spawning areas

outIndivs

- csv filename for individual start and end locations

Details

If the ibmResTbl dataframe is NULL, the user can select the file using a file dialog box).

If the cellsTbl dataframe is NULL, the user can select the file using a file dialog box).

If the writeCSVs flag is set, the two files specified by outConn and outIndivs are written before the function is exited.

Note: this function calculates successful individuals using the dfrIC dataframe based on their final location being in on of the defined nursery zones, not on reaching the final life stage.

Uses wtsUtilities::getCSV and sqldf::sqldf.

Value

list w/ 2 elements:
dfrCM - dataframe with probability of transport to a sink (nursery area) conditioned on starting in a source (spawning area)
dfrNR - numbers by source (spawning area)
dfrIC - dataframe of start and end locations for each individual in the model run


wStockhausen/wtsDisMELSConn documentation built on May 3, 2019, 7:36 p.m.