seagraph {SeaGraphs} | R Documentation |
Sea Currents To Connectivity Transformation
Description
Sea Currents To Connectivity Transformation
Usage
seagraph(component_u, component_v, mask_shapefile = NULL, k_neighbors = 7L)
Arguments
component_u |
|
component_v |
|
mask_shapefile |
Optional |
k_neighbors |
|
Details
Sea currents data of the input are transformed into weighted directed graph
connectivity data. Each centroid of component_u
and component_v
is
considered as a separate graph node. These connectivity data are provided in
sfnetwork, sf
, edge list and adjacency matrix form. An additional
data.frame
with correspondence between indices and coordinates for edge
list and adjacency matrix is returned as well. The weights in all outputs are
minmax-scaled in [0-1]
.
Extent, resolution and coordinate system of both must have the same for both
component_u
and component_v
; otherwise an error stops the
function's execution. In case that a mask_shapefile
is provided, then it
is internally assured that it has the same resolution or coordinates with
component_u
and a warning is prompted.
Value
SeaGraph
object, which is a list containing the following elements:
sfnetwork: sfnetwork object representing both graph and coordinates of the connectivity map.
sf:
sf
anddata.frame
object representing 'LINESTRING' rows of connections between nodes.edge_list:
matrix
object representing the edge list, where source ('from'), destination ('to') and weight ('weight') for each connection are returned.adj_mat:
matrix
object representing the weighted adjacency matrix of the nodes.ID_coords:
data.frame
object with the correspondence between indices and coordinates for edge list (edge_list) and adjacency matrix (adj_mat).
References
Nagkoulis, N., Adam, C., Mamoutos, I., Katsanevakis, S., and Mazaris, A. D. (2025). An ecological connectivity dataset for Black Sea obtained from sea currents. Data in Brief, 58, 111268. doi:10.1016/j.dib.2024.111268
See Also
Examples
graph_result <- seagraph(component_u = get_component_u(),
component_v = get_component_v(),
k_neighbors = 7)
## Example of mask usage
masked_result <- seagraph(component_u = get_component_u(),
component_v = get_component_v(),
mask_shapefile = get_mask_shapefile(),
k_neighbors = 7)