indivsInfo_ExtractEndByStage: Extract info by individual at end of each life stage

View source: R/indivsInfo_ExtractEndByStage.R

indivsInfo_ExtractEndByStageR Documentation

Extract info by individual at end of each life stage

Description

Function to extract info by individual at end of each life stage.

Usage

indivsInfo_ExtractEndByStage(
  sfs_indivs,
  addVars = "",
  hasSuccessful = FALSE,
  verbose = FALSE
)

Arguments

sfs_indivs

- list of sf dataframes returned by indivsInfo_ReorderResults for "connectivity results" files

addVars

- character vector with names of additional (non-default) variables to extract

hasSuccessful

- flag indicating that sfs_indivs include a "successful" column

verbose

- flag to print debugging info

Details

The input list of sf dataframes should be the one returned by indivsInfo_ReorderResults for the "connectivity results" files.

Value

sf dataframe with columns:

  • startTime

  • origID - original (starting) individual ID

  • endTime - ending time

  • endID - ending individual ID

  • endLHS - ending life stage

  • endGridCell - ID of ending ROMS grid cell

  • endLon - ending longitude

  • endLat - ending latitude

  • endDepth - ending depth (m)

  • endBathym - bathymetric depth (m) at ending location

  • endAge - ending age(d)

  • endNum - ending number

  • end..AddVars - columns corresponding to additional variables (names converted to camel case)

  • successful - flag indicating "success" (TRUE) or failure (FALSE) (e.g., settlement) [if hasSuccessful]=TRUE

  • endGeom - ending 2d location as SF_POINT

Note

For each individual, the end of the life stage is identified by the record with ageInStage>0, indicating transition to next life stage or death.

If additional variables (addVars) are requested in the output dataframe, the names are prepended by "end" and converted to camel case.


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