I have a raster that has 50 land cover classes. I am trying to combine multiple attributes from the attribute table into a single attribute. For example, I would like "Evergreen", "Semi-Evergreen" as - EVERGREEN.
I used the Editor Toolbar in ArcGIS and selected these features, but the Merge button on the Editor toolbar is greyed out. I read another solution that asked me to "delete the Shared Features tool on the Topology toolbar", but I was unable to do so. Apparently, deleting the "Shared Features" tool will activate the merge tool?
Either way, I would like to combine the attributes into a single attribute in R.
What I have tried in R so far (just loading and viewing the attributes)
> lulc_2015 <- raster("E:\\MasterThesis\\Absence Approach\\Data\\LandCover_Data\\2015_lulc")
> lulc_2015
class : RasterLayer
dimensions : 26782, 11768, 315170576 (nrow, ncol, ncell)
resolution : 60, 60 (x, y)
extent : 163125, 869205, 855611, 2462531 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=43 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : E:\2015_lulc
names : X2015_lulc
values : 1, 134 (min, max)
attributes :
ID COUNT CLASS_NAME
from: 1 118944856
to : 134 3589862 Settlement
> lulc_2015@data@attributes
[[1]]
ID COUNT CLASS_NAME
1 1 118944856
2 2 2397462 Evergreen
3 6 39397 Sub-tropical broadleaved
4 11 2457007 Semi-evergreen
5 12 8798892 Moist deciduous
6 13 184 Sal mixed moist deciduous
7 14 1076081 Teak mixed moist deciduous
8 15 6675337 Dry deciduous
9 17 1790087 Teak mixed dry deciduous
10 18 476694 Thorn forest
11 19 247793 Bamboo mixed
12 20 16 Temperate coniferous
13 22 1109 Sal
14 23 708833 Teak
15 25 138858 Bamboo
16 26 4 Pine
17 30 85417 Hardwickia
18 33 2179 Boswellia
19 35 210 Anogeissus pendula
20 41 107796 Mangrove
How do I combine these classes?
For those providing a possible solution, please note I am currently using Reclassify tool from the Spatial Analyst extension in ArcGIS to achieve the same, but if there is an alternative, please provide the same below.
r
tag is not an error, you could try using functionreclass
of theraster
package. Its use is quite straightforward: artax.karlin.mff.cuni.cz/r-help/library/raster/html/…