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
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) )
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.
LCC raster, e.g., LCC2005
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
A logical indicating whether some internal tests should be run to
ensure the function is running correctly.
data.table with two columns,
This represents the new codes to used in the
These should have no values overlapping with
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.