knitr::opts_chunk$set( collapse = TRUE, comment = "#>", message=FALSE, warning=FALSE )
```{css, echo=FALSE} / CSS to style chunk headers / .chunk-title { background-color: #f0f0f0; / Background color / border: 1px solid #ccc; / Border / padding: 8px 10px; / Padding / margin-top: 20px; / Top margin / margin-bottom: 10px; / Bottom margin / font-weight: bold; / Font weight / }
```r library(Makurhini) library(sf) library(ggplot2)
We explored the MK_Fragmentation() to estimate fragmentation statistics at the landscape and patch/node level.
In this example, the MK_Fragmentation()
function was applied to estimate the connectivity of 404 remnant habitat nodes/patches, which were modeled to 40 non-volant mammal species of the Trans-Mexican Volcanic System (TMVS) by Correa Ayram et al., (2017).
data("habitat_nodes", package = "Makurhini") nrow(habitat_nodes) # Number of nodes plot(st_geometry(habitat_nodes), col = "#00B050")
To define the edge of the nodes we will use a distance of 500 m from the limit of the nodes (Haddad et al. 2015).
Fragmentation_test <- MK_Fragmentation(nodes = habitat_nodes, edge_distance = 500, plot = TRUE, min_node_area = 100, landscape_area = NULL, area_unit = "km2", perimeter_unit = "km")
names(Fragmentation_test) Fragmentation_test$`Summary landscape metrics (Viewer Panel)`
head(Fragmentation_test[[2]])
We can visualize the static at the patch level using the default plot() function or other spatial information display packages like the 'tmap' package, for example:
plot(Fragmentation_test[[2]]["CAPercent"], breaks = "jenks")
plot(Fragmentation_test[[2]]["EdgePercent"], breaks = "jenks")
plot(Fragmentation_test[[2]]["PARA"], breaks = "jenks")
plot(Fragmentation_test[[2]]["ShapeIndex"], breaks = "jenks")
plot(Fragmentation_test[[2]]["FRAC"], breaks = "quantile")
We can make a loop where we explore different edge depths. In the following example, We will explore 10 edge depths (edge_distance argument): 100, 200, 300, 400, 500, 600, 700, 800, 900 and 1000 meters. We will apply the 'MK_Fragmentation' function using the previous distances and then, we will extract the core area percentage and edge percentage statistics. Finally, we will plot the average of the patch core area percentage and edge percentage (% core area + % edge = 100%).
library(purrr) Fragmentation_test.2 <- map_dfr(seq(100, 1000, 100), function(x){ x.1 <- MK_Fragmentation(nodes = habitat_nodes, edge_distance = x, plot = FALSE)[[2]] CA <- mean(x.1$CAPercent) Edge <- mean(x.1$EdgePercent) x.2 <- rbind(data.frame('Edge distance' = x, Type = "Core Area", Percentage = CA), data.frame('Edge distance' = x, Type = "Edge", Percentage = Edge)) return(x.2) }) head(Fragmentation_test.2)
ggplot(Fragmentation_test.2, aes(x = Edge.distance, y = Percentage, group = Type)) + geom_line(aes(color = Type))+ geom_point(aes(color = Type))+ ylim(0,100)+ scale_x_continuous("Edge depth distance (m)", labels = as.character(Fragmentation_test.2$Edge.distance), breaks = Fragmentation_test.2$Edge.distance)+ scale_color_brewer(palette="Dark2")+ theme_classic()
The average core area percentage (average patch area that has the least possible edge effect) for all nodes decreases by more than 70% when considering an edge effect with an edge depth distance of 1 km.
|Edge depth distance (m) | CoreArea (%)| |------------------------|:-----------:| |100 | 83.5% | |500 | 34.14% | |1000 | 9.78% |
Reference:
INEGI. (2013). Conjunto de datos vectoriales de uso del suelo y vegetación, serie V (capa unión), escala 1:250,000. Instituto Nacional de Estadística y Geografía, Aguascalientes.
McGarigal, K., S. A. Cushman, M. C. Neel, and E. Ene. 2002. FRAGSTATS: Spatial Pattern Analysis Program for Categorical Maps. Computer software program produced by the authors at the University of Massachusetts, Amherst. Available at the following web site: www.umass.edu/landeco/research/fragstats/fragstats.html.
Haddad et al. (2015). Science Advances 1(2):e1500052. DOI: 10.1126/sciadv.1500052.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.