spflow_network_pair-class: Class spflow_network_pair

spflow_network_pair-classR Documentation

Class spflow_network_pair

Description

An S4 class which holds information on origin-destination (OD) pairs. Each OD pair is composed of two nodes, each belonging to one network. All origin nodes must belong to the same origin network should be contained in one spflow_network-class() - and likewise for the destinations.

Usage

## S4 method for signature 'spflow_network_pair'
dat(object)

## S4 replacement method for signature 'spflow_network_pair'
dat(object, ...) <- value

## S4 method for signature 'spflow_network_pair'
id(object)

## S4 replacement method for signature 'spflow_network_pair'
id(object, ..., which = "pair") <- value

## S4 method for signature 'spflow_network_pair'
npairs(object)

## S4 method for signature 'spflow_network_pair'
nnodes(object)

## S4 method for signature 'spflow_network_pair'
update_dat(object, new_dat)

Arguments

object

A spflow_network_pair-class

value

An object to replace the existing id/data

which

A character indicating which of the ids to change, should be one of c("origin", "destination", "pair"). The first characters may be used as shortcuts.

new_dat

A data.frame

Slots

id_net_pair

A character identifying the set of origin-destination pairs

id_orig_net

A character that serves as identifier for the origin nodes

id_dest_net

A character that serves as identifier for the destination network

pair_data

A data.frame containing information on origin-destination pairs

Examples

## 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)

## 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))


LukeCe/spflow documentation built on Nov. 11, 2023, 8:20 p.m.