MK_dPCIIC: Estimate the probability of connectivity (PC) or the integral...

View source: R/MK_dPCIIC.R

MK_dPCIICR Documentation

Estimate the probability of connectivity (PC) or the integral index of connectivity (IIC) and prioritize nodes

Description

This function calculates both the overall landscape connectivity, and the importance (contribution) of each node (or habitat patch) for maintaining landscape connectivity. It uses the PC and IIC indexes under one or several distance thresholds.

Usage

MK_dPCIIC(
  nodes,
  attribute = NULL,
  weighted = FALSE,
  LA = NULL,
  area_unit = "m2",
  restoration = NULL,
  onlyrestor = FALSE,
  distance = list(type = "centroid", resistance = NULL),
  metric = c("IIC", "PC"),
  probability = NULL,
  distance_thresholds = NULL,
  threshold = NULL,
  overall = FALSE,
  onlyoverall = FALSE,
  parallel = NULL,
  parallel_mode = 1,
  write = NULL,
  id_sel = 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. If the 'restoration' argument is used, the data frame must include a third column for restoration values.
- 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.

weighted

logical. If the nodes are of raster type, you can weight the estimated area of each node by the attribute. When using this parameter the attribute parameter, which must be a vector of length equal to the number of nodes, usually has values between 0 and 1.

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.

restoration

Character or vector, (optional). This parameter specifies the binary restoration value indicating whether each node is existing or hypothetically added for restoration: 1 for existing nodes in the landscape and 0 for nodes to be added to the initial landscape. If NULL (default), all nodes are considered existing (as if all restoration values were 1). Otherwise:
- If nodes is a shapefile (spatial vector) or a data.frame, specify the name of the column containing the restoration values. If 'nodes' is a data.frame, it must have three columns: the first for node IDs, the second for attributes, and the third for restoration values.
- If nodes is a raster layer, provide a numeric vector with restoration values for each node in the raster.

onlyrestor

logical. If TRUE, then only restoration metric will be calculated.

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. Can be the same length as the distance_thresholds parameter.

overall

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

onlyoverall

logical. If TRUE, then only overall metrics will be calculated.

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/test_PC_". By default, nothing is saved. The saved objects are:
- The importance of each node or habitat patch. The format of the output file depends on the class of nodes (shapefile, raster, or table).
- Overall landscape connectivity table (if the overall argument is TRUE).

id_sel

Internal use only, not for users.

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 overall connectivity and the importance or contribution of each node to the overall landscape connectivity. The overall connectivity is computed using either the PC (Probability of Connectivity) or the IIC (Integral Index of Connectivity) metrics.

Value

- If only one distance was used in the parameter distance_thresholds then return an object of class sf with the node importance values (delta IIC or PC).
- If you add overall = TRUE, then a list containing the sf class object with the importance values of the nodes and a data.frame with the overall connectivity values will be returned.
- If you use the restoration parameter then an extra column will be returned to the sf object with the node importance values, unless you use the onlyrestor argument (i.e., equal to TRUE) only the restoration metric is estimated.
- 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

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)
data("habitat_nodes", package = "Makurhini")
nrow(habitat_nodes) # Number of patches
#Two distance threshold,
IIC <- MK_dPCIIC(nodes = habitat_nodes,
                attribute = NULL,
                area_unit = "m2",
                distance = list(type = "centroid"),
                LA = NULL,
                overall = TRUE,
                metric = "IIC",
                distance_thresholds = c(10000, 20000)) #10,20 km
IIC
plot(IIC$d20000$node_importances_d20000["dIIC"], breaks = "jenks")
plot(IIC$d20000$node_importances_d20000["dIICintra"], breaks = "jenks")
plot(IIC$d20000$node_importances_d20000["dIICflux"], breaks = "jenks")
plot(IIC$d20000$node_importances_d20000["dIICconnector"], breaks = "jenks")

#Using raster and resistance
data("habitat_nodes_raster", package = "Makurhini")
data("resistance_matrix", package = "Makurhini")
PC <- MK_dPCIIC(nodes = habitat_nodes_raster,
                attribute = NULL,
                distance = list(type = "least-cost",
                                resistance = resistance_matrix),
                metric = "PC", probability = 0.5,
                overall = TRUE,
                distance_thresholds = 40000) # 40 km
PC$overall_d40000
PC$node_importances_d40000
plot(PC$node_importances_d40000)

## End(Not run)

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