Use this function to calculate centrality measures. under one or several distance thresholds.

MK_RMCentrality(
  nodes,
  distance = list(type = "centroid"),
  distance_thresholds = NULL,
  binary = TRUE,
  probability = NULL,
  rasterparallel = FALSE,
  write = NULL,
  intern = TRUE
)

Arguments

nodes

Object of class sf, SpatialPolygonsDataFrame or raster. It must be in a projected coordinate system. If nodes is a raster layer then raster values (Integer) will be taken as "id".

distance

list. Distance parameters. For example: type, resistance,or keep. 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 have to use the "resistance" argument. To see more arguments see the ?distancefile.

distance_thresholds

numeric. Distance or distances thresholds to establish connections (in meters). For example, one distance: distance_threshold = 30000; two or more specific distances: distance_thresholds = c(30000, 50000); sequence distances: distance_thresholds = seq(10000,100000, 10000).

binary

logical. Binary metrics, it only considers the distance thresholds to establish if a pair of nodes is (1) or not connected (0). Probability argument is not necessary.

probability

numeric. Connection probability to the selected distance threshold, e.g., 0.5 that is 50 percentage of probability connection. Use in case of selecting the "PC" metric. If probability = NULL, then it will be the inverse of the mean dispersal distance for the species (1/α; Hanski and Ovaskainen 2000).

rasterparallel

logical. If nodes is "raster" then you can use this argument to assign the metrics values to the nodes raster. It is useful when raster resolution is less than 100 m2.

write

character. Write output shapefile. It is necessary to specify the "Folder direction" + "Initial prefix", for example, "C:/ejemplo".

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 implements Patch-Scale Connectivity or Centrality Measures. Radial measures: degree, strength (using probability argument, for weighted graphs), eigenvector centrality (eigen), and closeness centrality (close). Medial measures: betweenness centrality (BWC), node memberships (cluster), and modularity (modules, using probability argument). The function builds on functions out of Csardi’s ’igraph’ package.

References

Borgatti, S. P., & Everett, M. G. (2006). A Graph-theoretic perspective on centrality. Social Networks, 28(4), 466–484. https://doi.org/10.1016/j.socnet.2005.11.005 Hanski, I. and Ovaskainen, O. 2000. The metapopulation capacity of a fragmented landscape. Nature 404: 755–758.

Examples

if (FALSE) { library(Makurhini) library(sf) data("vegetation_patches", package = "Makurhini") nrow(vegetation_patches) # Number of patches #Two distance threshold, centrality_test <- MK_RMCentrality(nodes = vegetation_patches, distance = list(type = "centroid"), distance_thresholds = c(10000, 100000), probability = 0.05, write = NULL) centrality_test plot(centrality_test$d10000["degree"], breaks = "jenks") plot(centrality_test$d10000["BWC"], breaks = "jenks") plot(centrality_test$d10000["cluster"], breaks = "jenks") plot(centrality_test$d10000["modules"], breaks = "jenks") }