Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lulc_2015 <- raster("E:\LandCover_Data\2015_lulc")
- #Load matrix to be used for reclassification
- rec <- read.csv("E:\LandCover_ReclassifyMatrix.csv")
- #Reclassifying the Raster to convert 70 LC to 15 LC
- rc <- as.matrix(data.frame(from=rec$V2, to=rec$To))
- New_LULC_2015 <- reclassify(lulc_2015,rc)
- New_LULC_2015 <- ratify(New_LULC_2015)
- rat <- data.frame(
- ID= 1:15,
- LandCover = c("Evergreen","Deciduous","Mixed Forest",
- "grass","Degraded Forest","Scrubland",
- "Dry Grassland","Wet Grassland","Plantation",
- "Settlement","High Elevation Plantation","Coastal",
- "Barren Land","Cropland","Wetlands")
- )
- levels(New_LULC_2015)<- rat
- # Resampled raster to achieve same resolution as other data
- Resam_LC <- resample(agg_modal, newelev, method='ngb')
- > Resam_LC
- class : RasterLayer
- dimensions : 642, 382, 245244 (nrow, ncol, ncell)
- resolution : 1000, 1000 (x, y)
- extent : 461951, 843951, 892583.3, 1534583 (xmin, xmax, ymin, ymax)
- coord. ref. : +proj=utm +zone=43 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
- data source : in memory
- names : layer
- values : 1, 15 (min, max)
- attributes :
- ID LandCover
- from: 1 Evergreen
- to : 15 Wetlands
- > raster(Resam_LC@data@attributes[[1]]$ID==1)
- Error in (function (classes, fdef, mtable) :
- unable to find an inherited method for function ‘raster’ for signature
- ‘"logical"’
Add Comment
Please, Sign In to add comment