An S4 class that contains all information on a single network.
In this representation a network is composed of nodes which must be
identified uniquely by and ID.
Each node is described by variables stored in a data.frame.
The node neighborhood matrix describes strength of links between the nodes
of the network.
The class is constructed by the sp_network_nodes()
function.
# S4 method for sp_network_nodes dat(object) # S4 method for sp_network_nodes dat(object) <- value # S4 method for sp_network_nodes id(object) # S4 method for sp_network_nodes id(object) <- value # S4 method for sp_network_nodes neighborhood(object) # S4 method for sp_network_nodes neighborhood(object) <- value # S4 method for sp_network_nodes nnodes(object)
object | A sp_network_nodes-class |
---|---|
value | An object to replace the existing id/data/neighborhood |
network_id
A character that serves as an identifier for the network
nnodes
A numeric that indicates the number of nodes in the network
node_data
A data.frame that contains all information describing the nodes
node_neighborhood
A matrix that describes the neighborhood relations of the nodes
Other spflow network classes:
sp_multi_network-class
,
sp_network_pair-class
,
spflow_network_classes
## access the data describing the nodes new_dat <- dat(germany_net) # access the id of the network germany_net2 <- germany_net id(germany_net2)#> [1] "ge"id(germany_net2) <- "Germany" # access the neighborhood matrix of the nodes neighborhood(germany_net)#> 16 x 16 sparse Matrix of class "dgCMatrix" #> #> SH . 0.5000000 0.5000000 . . . . . #> HH 0.2 . 0.2000000 0.2000000 0.2000000 0.2000000 . . #> MV 0.2 0.2000000 . . 0.2000000 0.2000000 0.2000000 . #> NW . 0.2500000 . . 0.2500000 . . 0.2500000 #> HB . 0.1428571 0.1428571 0.1428571 . 0.1428571 . 0.1428571 #> BB . 0.1428571 0.1428571 . 0.1428571 . 0.1428571 . #> BE . . 0.2500000 . . 0.2500000 . . #> RP . . . 0.2000000 0.2000000 . . . #> NI . . . 0.1250000 0.1250000 0.1250000 . 0.1250000 #> ST . . . . 0.1428571 0.1428571 0.1428571 . #> SN . . . . . 0.2500000 0.2500000 . #> SL . . . . . . . 0.2500000 #> HE . . . . . . . 0.1428571 #> TH . . . . . . . . #> BW . . . . . . . . #> BY . . . . . . . . #> #> SH . . . . . . . #> HH . . . . . . . #> MV . . . . . . . #> NW 0.2500000 . . . . . . #> HB 0.1428571 0.1428571 . . . . . #> BB 0.1428571 0.1428571 0.1428571 . . . . #> BE . 0.2500000 0.2500000 . . . . #> RP 0.2000000 . . 0.2000000 0.2000000 . . #> NI . 0.1250000 . 0.1250000 0.1250000 0.1250000 . #> ST 0.1428571 . 0.1428571 . 0.1428571 0.1428571 . #> SN . 0.2500000 . . . 0.2500000 . #> SL 0.2500000 . . . 0.2500000 . 0.2500000 #> HE 0.1428571 0.1428571 . 0.1428571 . 0.1428571 0.1428571 #> TH 0.1666667 0.1666667 0.1666667 . 0.1666667 . 0.1666667 #> BW . . . 0.2500000 0.2500000 0.2500000 . #> BY . . . . 0.3333333 0.3333333 0.3333333 #> #> SH . #> HH . #> MV . #> NW . #> HB . #> BB . #> BE . #> RP . #> NI . #> ST . #> SN . #> SL . #> HE 0.1428571 #> TH 0.1666667 #> BW 0.2500000 #> BY .#> [1] 16