assert1
: Assert that ecoregionCodes
that were replaced, were correctly identified;
This is the full pixelCohortData
, not the collapsed one.
assert1(
cohortData34to36,
cohortData,
rmZeroBiomassQuote,
classesToReplace = 34:36,
doAssertion = getOption("LandR.assertions", TRUE)
)
assert2(
cohortDataNo34to36,
classesToReplace = 34:36,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSppMaxBMaxANPP(
speciesEcoregion,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertUniqueCohortData(
cohortData,
columns,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertERGs(
ecoregionMap,
cohortData,
speciesEcoregion,
minRelativeB,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertColumns(
obj,
colClasses,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertCohortData(
cohortData,
pixelGroupMap,
maxExpectedNumDiverge = 1,
message = "",
doAssertion = getOption("LandR.assertions", TRUE),
verbose = getOption("LandR.verbose", TRUE),
cohortDefinitionCols = c("pixelGroup", "age", "speciesCode")
)
assertPixelCohortData(
pixelCohortData,
pixelGroupMap,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSpeciesPlotLabels(
speciesNames,
sppEquiv,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertFireToleranceDif(
burnedPixelCohortData,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSpeciesLayers(
speciesLayers,
thresh,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertRstLCChange(
rstLCChange,
rasterToMatch,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSpeciesEcoregionCohortDataMatch(
cohortData,
speciesEcoregion,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertPixelCohortDataValid(
standCohortData,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertRepsAllCohortData(
allCohortData,
reps,
years,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertStandAgeMapAttr(
standAgeMap,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertCohortDataAttr(
cohortData,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSppVectors(
sppEquiv = NULL,
sppNameVector = NULL,
sppColorVect = NULL,
sppEquivCol = NULL,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSpeciesTableRaw(
speciesTableRaw,
doAssertion = getOption("LandR.assertions", TRUE)
)
assertSpeciesTable(
speciesTable,
doAssertion = getOption("LandR.assertions", TRUE)
)
A cohortData
data.table
with only the
pixels what were LCC 34:36
A data.table
with columns: pixelGroup
, ecoregionGroup
,
speciesCode
, and optionally age
, B
, mortality
, aNPPAct
, and sumB
.
An expression to evaluate, in the form of quote(B>0)
,
used to select cohorts with biomass.
Integer vector of classes that are are to be replaced, e.g., 34, 35, 36 on LCC2005, which are burned young, burned 10 year, and cities.
A logical indicating whether some internal tests should be run to
ensure the function is running correctly.
Default: getOption("LandR.assertions", TRUE)
.
A cohortData
data.table
with only the
pixels what were LCC 34:36
A data.table
with species
-ecoregion
-specific species trait values.
Ecoregion refers to "ecolocation", a categorical variable grouping sites with similar biophysical
characteristics. The table should have at least the following columns: speciesCode
and
ecoregionGroup
, character representation of species and ecoregion groups respectively,
maxB
the maximum biomass for the species in a given 'ecoregion', maxANPP
the maximum
aboveground net primary productivity and SEP
the species establishment probability.
May contain columns inflationFactor
(used to adjust maxB
) and mANPPproportion
(used to calculate maxANPP
).
Vector of column names on which to test for unique cohortData
The ecoregionMap
, a raster of all the unique ecoregion groupings,
which group together pixels of similar biophysical characteristics.
a data.frame
with the cut points to classify stand shadiness.
A data.frame
- or data.table
-like object
A named vector of column classes, where the names are the column names
A RasterLayer
with pixel values equal to a pixel group
number that corresponds exactly to pixelGroup
column in cohortData
.
A numeric, length 1, indicating by how many they can diverge. Default 1.
An optional message to print. This may help identify where this function was called.
Controls message output. Defaults to getOption("LandR.verbose")
the columns in cohortData
that define unique cohorts
The full cohortData
data.table
A vector of species names for which the labels will be checked
an table with a column containing species names
An expanded cohortData
data.table
with pixel-level
cohort information on burnt pixels and the following (optional) columns:
severity
- fire severity in that pixel calculated based on fire behaviour properties;
firetolerance
- species-level fire tolerance;
severityToleranceDif
- the difference between severity
and firetolerance
.
A RasterStack
or RasterLayer
that
should contain species cover data in the study area
the minimum number of pixels where the species must have
biomass > 0
to be considered present in the study area.
Defaults to 1.
a raster layer indicating pixels were land-use change occurred as 1s
A RasterLayer
objects to use as the template for all subsequent
raster operations (i.e., the one used throughout the simulation).
A data.table
with simulated and observed stand data for validation
A data.table
with all simulated cohortData
to use for
validation
repetition ids
years
A rasterLayer
of stand ages with attribute "imputedPixID"
A character vector of species to use. These species must all
be from one naming convention, i.e., from one column in the sppEquiv
.
A named vector of colours to use for plotting.
The names must conform with species name convention used
(see sppEquivalencies_CA for possible naming
conventions) and should also contain a colour for 'Mixed',
when a mixed forest type is supported (see vegLeadingProportion
parameter in vegTypeGenerator()
for details on mixed
forest types).
the column name to use from sppEquiv
.
raw species traits data.table
(see getSpeciesTable()
)
species traits data.table
(see prepSpeciesTable()
)