updateEdges: Update edges

Description Usage Arguments Details Value

View source: R/RCX-NodesAndEdges.R

Description

This functions add edges in the form of a Edges object to an other Edges or an RCX object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
updateEdges(x, edges, stopOnDuplicates = F, keepOldIds = T, ...)

## S3 method for class 'EdgesAspect'
updateEdges(x, edges, stopOnDuplicates = F, keepOldIds = T, ...)

## S3 method for class 'RCX'
updateEdges(
  x,
  edges,
  stopOnDuplicates = F,
  keepOldIds = T,
  checkReferences = T,
  ...
)

Arguments

x

RCX-object or Edges object; (to which the new Edges will be added)

edges

Edges object; (the Edges, that will be added)

stopOnDuplicates

logical (optional); whether to stop, if duplicates in id column are found, or re-assign ids instead.

keepOldIds

logical (optional); if ids are re-assigned, the original ids are kept in the column oldId

...

additional parameters

checkReferences

logical; whether to check if references to other aspects are present in the RCX object

Details

When edges should be added to a Edges or a RCX-object object some conflicts may rise, since the aspects might use the same IDs. If the aspects do not share any IDs, the two aspects are simply combined. Otherwise, the IDs of the new edges are re-assinged continuing with the next available ID (i.e. maxId(edgesAspect) + 1 and maxId(rcx$edges) + 1, respectively).

To keep track of the changes, it is possible to keep the old IDs of the newly added edges in the automatically added column oldId. This can be omitted by setting keepOldIds to FALSE. Otherwise, if a re-assignment of the IDs is not desired, this can be prevented by setting stopOnDuplicates to TRUE. This forces the function to stop and raise an error, if duplicated IDs are present.

Value

Edges or RCX with added edges


frankkramer-lab/RCX documentation built on July 14, 2021, 6:33 p.m.