MK_Focal_nodes: Estimate the focal integral index of connectivity or the...

View source: R/MK_Focal_nodes.R

MK_Focal_nodesR Documentation

Estimate the focal integral index of connectivity or the focal probability of connectivity

Description

This function enables the calculation of the focal Integral Index of Connectivity (\mathbf{IIC}_f) or the focal Probability of Connectivity (\mathbf{PC}_f) under one or more distance thresholds. Furthermore, this function estimates the composite connectivity index (\mathbf{CCI}_f; for further details, please see Latorre-Cárdenas et al., 2023).

Usage

MK_Focal_nodes(
  nodes = NULL,
  id = NULL,
  attribute = NULL,
  raster_attribute = NULL,
  fun_attribute = NULL,
  weighted = FALSE,
  area_unit = "ha",
  distance = list(type = "centroid", resistance = NULL),
  metric = "IIC",
  probability = NULL,
  distance_thresholds = NULL,
  search_buffer = NULL,
  simplify_shape = NULL,
  fragmentation = FALSE,
  edge_distance = 500,
  min_node_area = 100,
  parallel = NULL,
  write = NULL,
  save_subfiles = FALSE,
  intern = TRUE
)

Arguments

nodes

sf, SpatVector, SpatialPolygonsDataFrame. Object containing nodes (e.g., habitat nodes or fragments) to analyze information. Nodes are spatial data of type vector (class sf, SpatVector, SpatialPolygonsDataFrame). It must be in a projected coordinate system.

id

character. Column name with the node ID.

attribute

character or vector. If NULL 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.

raster_attribute

raster, rast. Raster object used to assign the attribute values of each node using the function specified in the fun_attribute parameter.

fun_attribute

function. Specifies the function to estimate the node attribute when the raster_attribute parameter is not NULL. The function extracts the raster values in the raster_attribute parameter for each node, then applies the selected function to this parameter to obtain a single value for each node. For example, mean, sum, modal, min or max. Two of the most popular functions are mean and sum, Default = mean.

weighted

logical. If the parameters raster_attribute and weighted are TRUE then the value of the raster attribute for each node is multiplied by its area to obtain an attribute similar to a weighted habitat 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 list of parameters 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.
This list 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.

search_buffer

numeric. Distance or distances (i.e., it can be a search distance for each dispersion distance of the parameter distance_thresholds) used to create a buffer around the focal node (also called focal habitat patch), which is used to select neighbouring nodes (transboundary habitat patches) with which it has the highest probability of connectivity.

simplify_shape

numeric. It helps to simplify the shape of the focal node by eliminating vertices to buffer and select neighbouring nodes. Its use is recommended when some of the nodes have very complex shapes. See st_simplify for details.

fragmentation

logic. Estimates fragmentation statistics for the focal nodes using the function MK_Fragmentation. It is necessary to use the parameters edge_distance and min_node_area.

edge_distance

numeric. Distance to edge in meters. Default equal 500 m. See MK_Fragmentation for details.

min_node_area

numeric. Minimum node area used to calculate the number of nodes with an area smaller than the one provided. Default equal 100 km2. It uses the area units set in the area_unit parameter. See MK_Fragmentation for details.

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.

write

Character indicating the path and initial prefix of the objects to save, for example, "C:/example/test_focal_". By default, nothing is saved. The saved object is a geopackage.

save_subfiles

character, logical. Save the result for each focal node in a local folder in .rds format. If the value is TRUE, a folder will be generated in the path specified in the write parameter. Otherwise, the folder path must be provided (e.g., 'C:/example'). This parameter is particularly useful in the event of a topological error in the estimation process. For instance, if the function fails due to a topological error in node 601 of 1,000 nodes, the results of the preceding 600 nodes will be saved. You can then correct node 601 and resume your analysis by specifying the address of the folder where your 600 node files were saved.

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

A loop is executed, whereby each of the nodes is selected. In each iteration, the following occurs:
1- When node i is selected, it becomes a focal node (f).
2- Then, a buffer is generated with the distance specified in parameter search_buffer, for example the for example twice the dispersion distance specified in the parameter distance_thresholds. This buffer is called local landscape and is used to identify neighboring nodes, called transboundary nodes (th).
3- Next, the index IIC or PC is estimated according to the selected metric using the focal node and the transboundary nodes. This result is referred to as \mathbf{IIC}_f or \mathbf{PC}_f. The index value ranges from 0 to 1, with 1 representing the highest connectivity in the local landscape for the focal node.
4- Subsequently, the delta dIIC or dPC is estimated for the focal node, along with its intra, flux, and connector deltas.
5- The function calculates the Composite Connectivity Index (\mathbf{CCI}_f) as a prioritization tool for focal nodes. This is based on their individual contribution, weighted by the connectivity in the local landscape: \mathbf{CCI}_f = \mathbf{IIC}_f \cdot \mathbf{dIIC}_f or \mathbf{CCI}_f = \mathbf{PC}_f \cdot \mathbf{dPC}_f. Nodes, with higher \mathbf{CCI}_f values are found in well-connected local landscapes, making them valuable contributors to connectivity in their immediate landscapes. This makes them ideal candidates for conservation efforts. Conversely, lower \mathbf{CCI}_f values may indicate the need for restoration and conservation actions. 6- In the final step, if the parameter fragmentation is set to TRUE, fragmentation statistics are estimated for the local landscape.

This process is repeated for each node and stored in an object class sf. For further details, please see Latorre-Cárdenas et al., 2023

Note

Sometimes the advance process does not reach 100 percent when operations are carried out very quickly.

References

Latorre-Cárdenas, M. C., González-Rodríguez, A., Godínez-Gómez, O., Arima, E. Y., Young, K. R., Denvir, A., ... & Ghilardi, A. (2023). Estimating fragmentation and connectivity patterns of the temperate forest in an avocado-dominated landscape to propose conservation strategies. Land, 12(3), 631.

Examples

## Not run: 
library(Makurhini)
data("habitat_nodes", package = "Makurhini")
nrow(habitat_nodes) # Number of patches
test <- MK_Focal_nodes(nodes = habitat_nodes,
                         id = "Id",
                         attribute = NULL,
                         raster_attribute = NULL,
                         fun_attribute = NULL,
                         distance = list(type = "centroid"),
                         metric = "PC",
                         probability = 0.5,
                         parallel = 4,
                         distance_thresholds = 10000,
                         search_buffer = 20000,
                         fragmentation = TRUE)
plot(test["dPC"], breaks = "jenks")
plot(test["IComp"], breaks = "jenks")

## End(Not run)

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