spflow_network(
  id_net,
  node_neighborhood = NULL,
  node_data = NULL,
  node_key_column,
  node_coord_columns,
  derive_coordinates = missing(node_coord_columns),
  prefer_lonlat = TRUE,
  normalize_byrow = FALSE
)

Arguments

id_net

A character that serves as an identifier for the set of nodes

node_neighborhood

A matrix that describes the neighborhood of the nodes

node_data

A data.frame that contains all information describing the nodes

node_key_column

A character indicating the column containing the identifiers for the nodes

node_coord_columns

A character indicating the columns that represent the coordinates of the nodes. For example c("LON", "LAT").

derive_coordinates

A logical indicating whether there should be an attempt to infer the coordinates from the node_data.

prefer_lonlat

A logical indicating whether the coordinates should be transformed to longitude and latitude.

normalize_byrow

A logical, if TRUE the neighborhood will be row-normalized, otherwise it is scaled to have a spectral radius of one.

Value

An S4 class of type spflow_network-class()

Examples

spflow_network(
  "germany",
  spdep::nb2mat(spdep::poly2nb(germany_grid)),
  as.data.frame(germany_grid),
  "ID_STATE")
#> Spatial network nodes with id: germany
#> --------------------------------------------------
#> Number of nodes: 16
#> Average number of links per node: 5.125
#> Density of the neighborhood matrix: 32.03% (non-zero connections)
#> 
#> Data on nodes:
#>    ID_STATE  X COORD_X COORD_Y
#> SH       SH 10       1       5
#> HH       HH 15       1       4
#> MV       MV 20       2       4
#> NW       NW  7       0       3
#> HB       HB 20       1       3
#> BB       BB 25       2       3
#> BE       BE 15       3       3
#> RP       RP 10       0       2
#> NI       NI 30       1       2
#> ST       ST 20       2       2
#> SN       SN 15       3       2
#> SL       SL 10       0       1
#> HE       HE 15       1       1
#> TH       TH 10       2       1
#> BW       BW  7       1       0
#> BY       BY  7       2       0
#>