add_tvertices.tempnetwork: This function adds a series of vertices to every graph in the...

Description Usage Arguments Value

View source: R/tempnetwork-basic.R

Description

This function adds a series of vertices to every graph in the graph-list of the given 'tempnetwork'-object and creates corresponding equivalence-classes and adds them to the equivalence-relation of the given 'tempnetwork'-object.

Usage

1
2
3
4
## S3 method for class 'tempnetwork'
add_tvertices(tempNetwork, tVertexNameList,
  gVertexNameList = rep(tVertexNameList, each = length(tP(tempNetwork))),
  pointNameList = NULL, safe = TRUE)

Arguments

tempNetwork

A 'tempnetwork'-object.

tVertexNameList

A vector of strings representing the names of the new equivalence classes. It must be either the of the same length as the vector "gVertexNameList" or its length must be the length of the vector "gVertexNameList" divided by N, where N is the number of points in the 'tempflow'-object of the given 'tempnetwork'-object. If the latter is the case, it will be assumed that the first entry of this vector corresponds with the first N entries in the "gVertexNameList"-vector.

gVertexNameList

A vector of strings representing the vertices to be added to the graphs in the graph-list. As every graph must have the same size (vertex set) the length of this vector must be a multiple of 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 classes specified in the "tVertexNameList"-vector.

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 taken a replicated until the resulting vector has the same length as the vector "gVertexNameList".

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 the specified vertices (the names ow which are specified through the vectors "gVertexNameList" and "pointNameList"); an equivalence relation that extends the equivalence-relation from the given 'tempnetwork'-object, by the equivalence-classes specified in the vector "tVertexNameList" 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.