MK_dPCIIC_links: Estimate the differential of the connectivity indexes IIC and...

View source: R/MK_dPCIIC_links.R

MK_dPCIIC_linksR Documentation

Description

This function calculates the dPC or dIIC index to estimate the link importance for conservation and restoration. It calculates the contribution of each individual link to maintain (mode: link removal) or improve (mode: link change) the overall connectivity under one or several distance thresholds.

Usage

MK_dPCIIC_links(
  nodes,
  attribute = NULL,
  LA = NULL,
  area_unit = "m2",
  distance = list(type = "centroid", resistance = NULL),
  metric = c("IIC", "PC"),
  probability = NULL,
  distance_thresholds = NULL,
  threshold = NULL,
  removal = TRUE,
  change = NULL,
  overall = FALSE,
  parallel = NULL,
  parallel_mode = NULL,
  write = NULL,
  intern = TRUE
)

Arguments

nodes

Object containing nodes (e.g., habitat patches or fragments) information. It can be of the following classes:
- Data.frame with at least two columns: the first for node IDs and the second for attributes.
- Spatial data of type vector (class sf, SpatVector, SpatialPolygonsDataFrame). It must be in a projected coordinate system.
- Raster (class RasterLayer, SpatRaster). It must be in a projected coordinate system. The values must be integers representing the ID of each habitat patch or node, with non-habitat areas represented by NA values (see clump or patches).

attribute

Character or vector. If NULL (only applicable when nodes is of spatial data of vector or raster type) the area of the nodes will be used as the node attribute. The unit of area can be selected using the area_unit parameter. To use an alternative attribute, consider the class type of the object in the nodes parameter:
- If nodes is a spatial vector or data.frame, specify the name of the column containing the attribute for the nodes.
- If nodes is a raster layer then it must be a numeric vector with the node's attribute. The length of the vector must be equal to the number of nodes. If the parameter weighted is TRUE then the numeric vector is multiplied by the area of each node to obtain a weighted habitat index.

LA

numeric. (optional, default = NULL). The maximum landscape attribute, which is the attribute value that would correspond to a hypothetical habitat patch covering all the landscape with the best possible habitat, in which IIC and PC would be equal to 1. For example, if nodes attribute corresponds to the node area, then LA equals total landscape area. If nodes attribute correspond to a quality-weighted area and the quality factor ranges from 0 to 100, LA will be equal to 100 multiplied by total landscape area. The value of LA does not affect at all the importance of the nodes and is only used to calculate the overall landscape connectivity. If no LA value is entered (default) and overall = TRUE or onlyoverall = TRUE, the function will only calculate the numerator of the global connectivity indices and the equivalent connected ECA or EC index.

area_unit

character. (optional, default = "m2")
. A character indicating the area units when attribute is NULL. Some options are "m2" (the default), "km2", "cm2", or "ha"; See unit_convert for details.

distance

A matrix or list to establish the distance between each pair of nodes. Distance between nodes may be Euclidean distances (straight-line distance) or effective distances (cost distances) by considering the landscape resistance to the species movements.
- If it is a matrix, then the number of columns and rows must be equal to the number of nodes. This distance matrix could be generated by the distancefile function.
- If it is a list of parameters, then it must contain the distance parameters necessary to calculate the distance between nodes. For example, two of the most important parameters: “type” and “resistance”. For "type" choose one of the distances: "centroid" (faster), "edge", "least-cost" or "commute-time". If the type is equal to "least-cost" or "commute-time", then you must use the "resistance" argument. For example: distance(type = "least-cost", resistance = raster_resistance).
To see more arguments see the distancefile function.

metric

A character indicating the connectivity metric to use: "PC" (the default and recommended) to calculate the probability of connectivity index, and "IIC" to calculate the binary integral index of connectivity.

probability

A numeric value indicating the probability that corresponds to the distance specified in the distance_threshold. For example, if the distance_threshold is a median dispersal distance, use a probability of 0.5 (50%). If the distance_threshold is a maximum dispersal distance, set a probability of 0.05 (5%) or 0.01 (1%). Use in case of selecting the "PC" metric. If probability = NULL, then a probability of 0.5 will be used.

distance_thresholds

A numeric indicating the dispersal distance or distances (meters) of the considered species. If NULL then distance is estimated as the median dispersal distance between nodes. Alternatively, the dispersal_distance function can be used to estimate the dispersal distance using the species home range.

threshold

numeric. Pairs of nodes with a distance value greater than this threshold will be discarded in the analysis which can speed up processing.

removal

logical indicating whether the link removal mode should be used to calculate link importance (see details). Default is TRUE.

change

(optional, default NULL). A numeric indicating the new distances used to calculate link importance under the link change mode should be (see details). By default, link change is not calculated.

overall

logical. If TRUE, then the EC index will be added to the result which is transformed into a list. Default equal to FALSE

parallel

(optional, default = NULL). A numeric specifying the number of cores to parallelize the index estimation of the PC or IIC index and its deltas.Particularly useful when you have more than 1000 nodes. By default the analyses are not parallelized.

parallel_mode

(optional, default = 1). A numeric indicating the mode of parallelization: Mode 1 (the default option, and recommended for less than 1000 nodes) parallelizes on the connectivity delta estimate, while Mode 2 (recommended for more than 1000 nodes) parallelizes on the shortest paths between vertices estimate.

write

Character indicating the path and initial prefix of the objects to save, for example, "C:/example". By default, nothing is saved. The saved objects are:
- The importance of each link. The format of the output file is a csv.
- Overall landscape connectivity table (if the overall argument is TRUE). The format of the output file is a csv.

intern

logical. Show the progress of the process, default = TRUE. Sometimes the advance process does not reach 100 percent when operations are carried out very quickly.

Details

This function calculates the importance or contribution of each link to the overall landscape connectivity. The importance of a link is calculated as the variation in the value of the PC or IIC indices after certain changes affecting that link. The link importance analysis can be performed under the following two different modes:
- If removal = TRUE, the function removes one by one each of the links existing in the landscape network and calculates the impact of that link loss on landscape connectivity with the dPC or dIIC metrics. This mode is useful to identify the priority links to conserve: the ones with the highest contribution to the overall landscape connectivity (highest dPC or dIIC value).
- If change! = NULL, the function replaces one by one each of the links existing in the landscape network and calculates the impact of that link change on landscape connectivity with the dPC or dIIC metrics. This mode is useful to identify the priority links to both conserve and restore. Positive dPC or dIIC values correspond to links losses or degradation, and the priority links to conserve correspond to those with the highest positive values. Negative dPC or dIIC values correspond to links improvements, and the priority links to restore correspond to those with the smallest negative values. This mode requires additional information, a distance matrix with the new distance values between all pairs of nodes. These new distance values will be in general different than the ones in the distance parameter. A smaller distance corresponds to an increase in the quality or strength of the link between two patches in a given change or restoration scenario. A higher distance means that the connection between those two patches gets weaker corresponding to a degradation scenario. All types of combinations and different types of changes are possible for each of the links. For example, some connections may be improved, some others may decrease their quality or even disappear completely (i.e., new distance = NA), and some other links may suffer no change at all in the same analysis, depending on the particular new distance values for each link.

Value

- If only one distance was used in the parameter distance_thresholds then return an object of class data.frame with the link removal or/and change values.
- If you add overall = TRUE, then a list containing the data.frame class object with the link removal or/and change values and a data.frame with the overall connectivity values will be returned.
- If you use multiple distance thresholds (e.g, distance_thresholds = c(1000, 5000, 80000)), the resulting data should be returned in the form of a list, wherein each list item contains the resulting objects for each distance threshold.

Note

The link importance analysis can be much more time consuming than the node importance analysis (i.e., MK_dPCIIC). Sometimes the advance process does not reach 100 percent when operations are carried out very quickly.

References

- Saura, S. & Torné, J. 2012. Conefor 2.6 user manual (May 2012). Universidad Politécnica de Madrid. Available at www.conefor.org.
- Pascual-Hortal, L. & Saura, S. 2006. Comparison and development of new graph-based landscape connectivity indices: towards the priorization of habitat patches and corridors for conservation. Landscape Ecology 21 (7): 959-967.
- Saura, S. & Pascual-Hortal, L. 2007. A new habitat availability index to integrate connectivity in landscape conservation planning: comparison with existing indices and application to a case study. Landscape and Urban Planning 83 (2-3): 91-103.
- Hanski, I. and Ovaskainen, O. 2000. The metapopulation capacity of a fragmented landscape. Nature 404: 755–758.

Examples

## Not run: 
library(Makurhini)

#Link removal option
data("habitat_nodes_spain", package = "Makurhini")
nrow(habitat_nodes_spain) # Number of patches
#For this example we only select first 50 nodes
nodes_test <- habitat_nodes_spain[1:50,]

#Distance
data("dist_original", package = "Makurhini")
#select the distances between the first 50 nodes
dist_test <- dist_original[1:50,1:50]

#We previusly estimate an Effective median dispersal distance
#of 980,966.64 m*cost. That is:
#mean resistance x 10 km of Euclidean median dispersal distance
delta <- MK_dPCIIC_links(nodes = nodes_test,
                         attribute = "attribute",
                         area_unit = "ha",
                         distance = dist_test,
                         removal = TRUE,
                         metric = "PC",
                         probability = 0.5,
                         distance_thresholds = 980966.64,
                         parallel = 4,
                         parallel_mode = 1,
                         intern = TRUE)
#Link change option
data("dist_restoration", package = "Makurhini")
#select the new distances between the first 50 nodes
dist_test_change <- dist_restoration[1:50,1:50]

delta <- MK_dPCIIC_links(nodes = nodes_test,
                         attribute = "attribute",
                         area_unit = "ha",
                         distance = dist_test,
                         change = distance_change
                         removal = TRUE,
                         metric = "PC",
                         probability = 0.5,
                         distance_thresholds = 980966.64,
                         parallel = 4,
                         parallel_mode = 1,
                         intern = TRUE)
delta

## End(Not run)

OscarGOGO/Makurhini documentation built on Jan. 9, 2025, 1:20 p.m.