Learn R Programming

spflow (version 0.1.0)

sp_network_pair-class: Class sp_network_pair

Description

An S4 class which holds information on origin-destination (OD) pairs. Each OD pair is composed of two nodes (see sp_network_nodes-class()). All origins belong to the same (origin-) network and all destination belong to the same (destination-) network. It is possible to choose the same network for origins and destinations, which enables to represent OD pairs within the same network.

Usage

# S4 method for sp_network_pair
dat(object)

# S4 method for sp_network_pair dat(object) <- value

# S4 method for sp_network_pair id(object)

# S4 method for sp_network_pair id(object) <- value

# S4 method for sp_network_pair npairs(object)

# S4 method for sp_network_pair nnodes(object)

Arguments

object

A sp_network_pair-class

value

An object to replace the existing id/data

Slots

orig_net_id

A character that serves as identifier for the origin network

orig_nnodes

A numeric that represents the number of nodes in the origin network

dest_net_id

A character that serves as identifier for the destination network

dest_nnodes

A numeric that represents the number of nodes in the destination network

network_pair_id

A character identifying the pair of networks

pair_data

A data.frame containing information on origin-destination pairs

npairs

A numeric indicating the number of origin-destination pairs

See Also

Other spflow network classes: sp_multi_network-class, sp_network_nodes-class, spflow_network_classes

Examples

Run this code
# NOT RUN {
## access the data describing the node pairs

net_pair_ge_ge <- pull_member(multi_net_usa_ge,"ge_ge")
dat(net_pair_ge_ge)

## access the id of a network pair

net_pair_ge_ge <- pull_member(multi_net_usa_ge,"ge_ge")
id(net_pair_ge_ge)
id(net_pair_ge_ge) <- "Germany_Germany"

## access the number of node pairs in a network pair

net_pair_ge_ge <- pull_member(multi_net_usa_ge,"ge_ge")
npairs(net_pair_ge_ge)

## access the number of origin and destination nodes in a network pair
net_pair_ge_ge <- pull_member(multi_net_usa_ge,"ge_ge")
nnodes(net_pair_ge_ge)
nnodes(net_pair_ge_ge)["orig"]
nnodes(net_pair_ge_ge)["dest"]
prod(nnodes(net_pair_ge_ge) == npairs(net_pair_ge_ge))

# }

Run the code above in your browser using DataLab