fixFactorRaster | R Documentation |
Creates a correctly-factored version of a misfactored
SpatRast
object.
fixFactorRaster(raster = NULL)
raster |
The faulty factor |
terra seems to have issues loading some factor raster files. For
instance, a factor raster made using the ArcGIS 'Polygon to Raster' tool and
then loaded with terra::rast()
will only show a 'Count' field instead
of the field specified in 'Polygon to Raster'. Additionally, the 'Count'
value assigned to each cell appears to be misleveled by 1 row when inspected
in the raster's terra::cats()
table. The fixFactorRaster()
function attempts to take a faulty raster and map its values to the correct
field, as it still exists in the terra::cats()
table.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.