Does the following:

  1. add new cohort data into cohortdata;

  2. assign initial biomass and age for new cohort;

  3. assign the new pixelgroup to the pixels that have new cohort;

  4. update the pixelgroup map.

addNewCohorts(newCohortData, cohortData, pixelGroupMap, time,
  speciesEcoregion)

Arguments

newCohortData

must be a complete cohortData object with entirely new pixelGroup values (i.e., already non-overlapping with cohortData. Columns it must have: pixelGroup, speciesCode, ecoregionGroup

cohortData

a data.table with columns: "pixelGroup", "ecoregionGroup", "speciesCode", "age", "B", "mortality", "aNPPAct", "sumB"

pixelGroupMap

Raster layer with pixel values equal to a pixel group number that correspondsd exactly to ]pixelGroup column in cohortData

time

Current time e.g., time(sim). This is used to extract the correct parameters in speciesEcoregion table if there are different values over time

speciesEcoregion

A speciesEcoregion table.

Value

A data.table with a new, rbindlisted cohortData