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

SpatRaster object with horizontal direction.

component_v

SpatRaster object with vertical direction.

mask_shapefile

Optional sf or SpatVector object for masking component_u and component_v SpatRaster objects. The default value is NULL, indicating that no mask is performed.

k_neighbors

integer object with the number k of nearest neighbors to use. The default is 7L.

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:

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

antpath_sfn, flows_sfn

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)

[Package SeaGraphs version 0.1.2 Index]