Takes a single data.table input, which has the following columns in addition to others that will be labelled with species name, and contain percent cover of each:

makeAndCleanInitialCohortData(
  inputDataTable,
  sppColumns,
  imputeBadAgeModel = quote(lme4::lmer(age ~ B * speciesCode + cover * speciesCode + (1 |
    initialEcoregionCode))),
  minCoverThreshold,
  doAssertion = getOption("LandR.assertions", TRUE),
  doSubset = TRUE
)

Arguments

inputDataTable

A data.table with columns described above.

sppColumns

A vector of the names of the columns in inputDataTable that represent percent cover by species, rescaled to sum up to 100%%.

imputeBadAgeModel

statistical model used to impute ages in pixels with missing data or with cover == 0. If set to NULL no imputation will be attempted, and pixels with missing age are excluded.

minCoverThreshold

minimum total cover percentage necessary to consider the pixel vegetated, or a cohort present in a pixel.

doAssertion

A logical indicating whether some internal tests should be run to ensure the function is running correctly. Default: getOption("LandR.assertions", TRUE).

doSubset

Turns on/off subsetting. Defaults to TRUE.

Value

a cohortData

data.table with attribute "imputedPixID"

(a vector of pixel IDs that suffered imputation).

Details

  • pixelIndex (integer)

  • age (integer)

  • logAge (numeric)

  • initialEcoregionCode (factor)

  • totalBiomass (integer)

  • lcc (integer)

  • rasterToMatch (integer)

  • speciesCode (factor)

  • cover (integer)

  • coverOrig (integer)

  • B (integer)

Several data correction/imputation operations are also performed. Namely, age is imputed in pixels where age data is missing (but not cover) and where cover == 0 but age > 0, total biomass is zeroed if age == 0, and age is zeroed if biomass == 0.

Author

Eliot McIntire