add_tVertex.tempnetwork: This function adds a new vertex to every graph in the...

Description Usage Arguments Value

View source: R/tempnetwork-basic.R

Description

This function adds a new vertex to every graph in the graph-list of the given 'tempnetwork'-object, creates a corresponding equivalence-class and adds it to the equivalence-relation of the given 'tempnetwork'-object.

Usage

1
2
3
add_tVertex.tempnetwork(tempNetwork, tVertexName,
  gVertexNameList = rep(tVertexName, length(tP(tempNetwork))),
  pointNameList = tP(tempNetwork)$name, safe = TRUE)

Arguments

tempNetwork

A 'tempnetwork'-object.

tVertexName

A string representing the name of the new equivalence-class.

gVertexNameList

A vector of strings representing the vertices to be added to the respective graphs in the graph-list. As every graph must have the same size (vertex set) the length of this vector must equal to the number of points in the 'tempflow'-object of the given 'tempnetwork'-object. As default it is assumed that those have the same name as the equivalence class, i.e. the string in "tVertexName".

pointNameList

A vector of strings representing the names of points in the 'tempflow'-object. The length of this vector must be identical to the length of the "gVertexNameList"-vector, as this vector is used to place the new vertex in the appropriate graph. As a default current ordering of points in the 'tempflow'-object of the given 'tempnetwork'-object is assumed.

safe

If TRUE it will be check that vector "gVertexNameList" and "pointNameList" have the same length. Moreover, it will be check if "pointNameList" is a multiple of the points in the 'tempflow'-object of the given 'tempnetwork'-object. Furthermore, it will be ensured that "tVertexName" is either a single string or a vector of strings with the same length as "gVertexNameList". Finally, all tempnetwork conditions will be checked to ensure that the resulting 'tempnetwork'-object satisfies all requirements.

Value

A new 'tempnetwork'-object, containing the same 'tempflow'-object as the previous one; a graph-list where each graph from the graph-list of the given 'tempnetwork'-object is extended by one vertex (the name of said vertex is specified through the vectors "gVertexNameList" and "pointNameList"); an equivalence relation that extends the equivalence-relation from the given 'tempnetwork'-object, by an equivalence-class named as specified in "tVertexName" and structured as defined through the vectors "gVertexNameList" and "pointNameList." Additionally, the "tempGraph"-field will be set to NULL.


KonstantinRK/tempnetwork documentation built on Dec. 23, 2019, 6:40 p.m.