indivsInfo_ExtractStartEnd: Extract info by individual at start and end of life or model...

View source: R/indivsInfo_ExtractStartEnd.R

indivsInfo_ExtractStartEndR Documentation

Extract info by individual at start and end of life or model run

Description

Function to extract info by individual at start and end of life or model run.

Usage

indivsInfo_ExtractStartEnd(
  sf_sebs = NULL,
  sf_start = NULL,
  sf_end = NULL,
  lst_indivs = NULL,
  startLHS = NULL,
  addVars = "",
  hasSuccessful = FALSE,
  verbose = FALSE,
  checkCalcs = FALSE
)

Arguments

sf_sebs

- (optional) sf dataframe returned by indivsInfo_ExtractStartEndByStage

sf_start

- (optional) sf dataframe returned by indivsInfo_ExtractStart

sf_end

- (optional) sf dataframe returned by indivsInfo_ExtractEnd

lst_indivs

- (req'd if sf_ebs and sf_start or sf_end is NULL) list of sf dataframes by life stage returned by indivsInfo_ReorderResults

startLHS

- (req'd if sf_start is NULL) life stage in which all individuals start

addVars

- (req'd if lst_indivs is given) character vector with names of additional (non-default) variables to extract

hasSuccessful

- flag indicating that input dataframes include a "successful" column

verbose

- flag to print debugging info

checkCalcs

- flag (T/F) to check endGeom is correctly assigned (for debugging)

Details

If provided, the input sf dataframe sf_sebs should be the output of indivsInfo_ExtractStartEndByStage. If sf_sebs is given as an input, addVars is ignored.

If sf_sebs is NULL, the input sf dataframes sf_start and sf_end can be given and should be the output of indivsInfo_ExtractStart and indivsInfo_ExtractEnd, respectively.

If either of these are NULL, lst_indivs must be given. This should be the list of sf dataframes by life stage returned by indivsInfo_ReorderResults.

If sf_start is NULL, startLHS must be given. If sf_start is NULL, it is calculated internally using sf_start = indivsInfo_ExtractStart(lst_indivs[[startLHS]],addVars=addVars).

If sf_end is NULL, it is calculated internally using sf_ebs = indivsInfo_ExtractEndByStage(lst_indivs,addVars=addVars) followed by sf_end = indivsInfo_ExtractEnd(sf_ebs).

Value

sf dataframe with columns:

  • startTime

  • origID - original (starting) individual ID

  • startLHS - starting life stage

  • startGridCell - ID of starting ROMS grid cell

  • startLon - starting longitude

  • startLat - starting latitude

  • startDepth - starting depth (m)

  • startBathym - bathymetric depth (m) at starting location

  • startAge - starting depth

  • startNum - starting depth

  • start..AddVars - starting values for additional (non-default) variables

  • startGeom - starting 2d location as SF_POINT

  • 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 - ending values for additional (non-default) variables

  • successful - flag indicating "success" (TRUE) or failure (FALSE) (e.g., settlement) [optional: depends on processing]

  • endGeom - ending 2d location as SF_POINT


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