Description Usage Arguments Value Examples
This function works similar to ArcMap's raster reclassify function, only fast and without starting hell on earth.
1 2 | reclassify(LUdata, reclasstable = "default", JIT = TRUE, dropNA = TRUE,
NAval = "default")
|
LUdata |
A dataset (vector, matrix or dataframe) that contains data to be reclassified, e.g., CORINE land cover data. If an object with multiple collumns is supplied, the function will reclassify only the first collumn. |
reclasstable |
the path to a .csv file containing the reclass table. By default, the function loads "corinetable", supplied with the package. This table maps Corine land-cover into the Classification scheme used in the LUISA framework of the Joint European Research centre. To inspect the table: data(corinetable); describe(corinetable). |
JIT |
a boolean indicating whether Just in Time compilation should be used. Defaults to TRUE. |
dropNA |
TRUE/FALSE indicating whether values that are reclassified into NoData should be dropped from the output. By default TRUE. |
NAval |
the value in the reclasstable that corresponds to noData. By default the function assumes that the classes have positive values, and that that the lowest negative value corresponds to the class that should be dropped (e.g., if your relcass table maps 1,2,3 into 1,2,-9999, the function will return a dataset with classes 1,2., and treat 3 as NoData, dropping it unless specified to keep NoData in the output). |
A vector of reclassified values, or matrix with the firs column being reclassified.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | A=c(1,2,3,4,5,6,7,8,9)
B=c(9,8,7,6,5,4,3,2,1)
reclasstable=cbind(A,B)
reclassify(A, reclasstable)
# by default, the data is not reclassified
reclassify(A)
# however, if dropNA is TRUE, thge default NA value is dropped (the most negative value)
C = c(1,2,3,4,5,6,7,8,9,-9999)
reclassify(C)
data(ITdata)
data(corinetable)
# reclassify a vector of land-use data using the corine_to_LUISA scheme:
landcover <- reclassify(LUdata=ITdata[,1], reclasstable=corinetable, JIT=TRUE)
#reclassify a multi-collumn dataset in which the first collumn represents factorial data:
reclass_IT <- reclassify(LUdata=ITdata, reclasstable=corinetable, JIT=TRUE)
# the LUISA codes are a simplification and drop certain land cover classes. By default,
# the categories reclassified into the lowest negative values, are dropped.
# If you wish to keep all categories:
reclass_IT <- reclassify(LUdata=ITdata, reclasstable=corinetable, dropNA=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.