The functions used here from the package raster are as follows:
Here we will provide an introduction to using the raster R package to make a homologation between land cover data and habitats, starting with ESA raster data.
esa_col <- raster("ESA_Col_Cob_2012.tif", na.rm= TRUE)
plot(esa_col, xlim= c(-80,-65), ylim= c(-5,15), main= "Coberturas ESA - Colombia")
mtx <- matrix(c(10,1401,11,1402,12,1401,30,1401,40,1406,50,105,60,105,61,105,80,101,90,101,100,1406,110,1406,120,305,122,305,130,405,150,600,153,600,160,107,170,107,180,406,190,1404,200,600,210,500,220,1700), ncol = 2, byrow = TRUE)
mtx
## [,1] [,2]
## [1,] 10 1401
## [2,] 11 1402
## [3,] 12 1401
## [4,] 30 1401
## [5,] 40 1406
## [6,] 50 105
## [7,] 60 105
## [8,] 61 105
## [9,] 80 101
## [10,] 90 101
## [11,] 100 1406
## [12,] 110 1406
## [13,] 120 305
## [14,] 122 305
## [15,] 130 405
## [16,] 150 600
## [17,] 153 600
## [18,] 160 107
## [19,] 170 107
## [20,] 180 406
## [21,] 190 1404
## [22,] 200 600
## [23,] 210 500
## [24,] 220 1700
esa_hab_rcl <- raster::reclassify(x= esa_col, rcl = mtx)
plot(esa_hab_rcl, main= "Homologación Coberturas-Habitats") #Resolucion espacial de 300 m
dem_colombia <- raster("dem_colombia3.tif")
dem_proj <- projectRaster(dem_colombia, crs = crs(esa_hab_rcl))
dem_al <- resample(dem_proj, esa_hab_rcl, method= "bilinear")
It was proposed to establish a limit of 500 meters to differentiate lowland from montane habitats.
esa_hab <- overlay(dem_al, esa_hab_rcl,
fun= function(altura, cover){
ifelse((altura >= 500) & (cover == 105),109,
ifelse((altura >= 500) & (cover == 305),307,
ifelse((altura >= 500) & (cover == 405),407,cover)))
})
plot(esa_hab, main= "Habitats_ESA_300m")
This is a representation with colors more suited to the kinds of habitats that can be generated. However, as it requires an additional transformation of the data, it is suggested to work with the map esa_hab.
df <- data.frame(rasterToPoints(esa_hab))
raster_test <- rasterFromXYZ(df[1:3])
cut <- sort(unique(esa_hab))
mypal <- c("darkcyan", "cornflowerblue", "chartreuse4", "darkorchid", "red", "chartreuse", "chartreuse4", "aquamarine3", "blue3", "darkorange", "blanchedalmond", "pink", "black", "darkkhaki")
plot(raster_test,
main= "Habitats_ESA_300m",
col= mypal,
breaks= cut)
This habitat map built from ESA covers can be an important input in updating and refining routines for the construction of species distribution models. For this reason, it is important to save a copy in .tif format in the working directory.
#writeRaster(esa_hab, "Habitats_ESA.tif", overwrite= T)
Beale, C. M. & Lennon, J. J. (2012). Incorporating uncertainty in predictive species distribution modelling. Philosophical Transactions of the royal society B, 367, 247-258.
Cobos, M. E., Peterson, A. T., Barve, N. & Osorio-Olvera, L. (2019a). kuenm: an R package for detailed development of ecological niche models using Maxent. Bioinformatics and genomics. PeerJ 7:e6281 https://doi.org/10.7717/peerj.6281
Cobos, M. E., Peterson, A. E., Osorio-Olvera, L. & Jiménez-García, D. (2019b). An exhaustive analysis of heuristic methods for variable selection in ecological niche modeling and species distribution modeling. Ecological Informatics, 53, 1-10.
Golding, N., August, T. A., Lucas, T. C. D., Gavaghan, D. J., van Loon, E. E. & McInerny, G. (2017). The zoon r package for reproducible and shareable species distribution modelling. Methods in ecology and evolution, 9, 260-268.
Hijmas, R. (2020). Raster package v.3.4-5. Available in https://www.rdocumentation.org/packages/raster/versions/3.4-5
Hijmas, R. (2021). The raster package. Available in https://rspatial.org/raster/pkg/RasterPackage.pdf
Jung, M., Dahal, P. R., Butchart, S. H. M., et al. (2020). A global map of terrestrial habitat types. Nature - Scientific data, 7:256, 1-8.
Kearney, M. (2006). Habitat, environment and niche: what are we modelling?. OIKOS, 115, 186-191.
Li, D., Dinnage, R., Nell, L. A., Helmus, M. R. & Ives, A. R. (2020). phyr: An r package for phylogenetic species‐distribution modelling in ecological communities. Methods in ecology and evolution, 11, 1455-1463.
Naimi, B. & Araújo, M. B. (2016). sdm: a reproducible and extensible R platform for species distribution modelling. Ecography, 39, 368-375.