R/cohorts.R
convertUnwantedLCC.Rd
This will search around the pixels on rstLCC
that have
classesToReplace
, and search in iteratively increasing
radii outwards for other Land Cover Classes than the those indicated in
classesToReplace
. This will constrain
It will then take the cohorts that were in pixels with classesToReplace
and assign them new values in the output object. This function will
also check that it must be an ecoregionCode
that already exists in
cohortData
, i.e., not create new ecoregionCode
values. See Details.
convertUnwantedLCC( classesToReplace = 34:36, rstLCC, availableERC_by_Sp, theUnwantedPixels, ecoregionGroupVec, speciesEcoregion, pixelClassesToReplace, doAssertion = getOption("LandR.assertions", TRUE) )
classesToReplace | 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. |
---|---|
rstLCC | LCC raster, e.g., LCC2005 |
availableERC_by_Sp | A |
theUnwantedPixels | An optional vector of pixel IDs that need to be changed.
If not provided, then pixels to change will be taken from the match between
|
ecoregionGroupVec | Deprecated. Use |
speciesEcoregion | Deprecated. Use |
pixelClassesToReplace | Deprecated. Use |
doAssertion | A logical indicating whether some internal tests should be run to
ensure the function is running correctly.
Default: |
A data.table
with two columns, pixelIndex
and ecoregionGroup
.
This represents the new codes to used in the pixelIndex
locations.
These should have no values overlapping with classesToReplace
.
This function is designed to be used in highly constrained situations, where it is not just replacing a Land Cover Class by a neighbouring Land Cover Class. But it can be used for the simpler cases of simply replacing a Land Cover Class.