View source: R/RCX-CartesianLayout.R
| updateCartesianLayout | R Documentation |
This functions add a cartesian layout in the form of a CartesianLayout object to an other CartesianLayout
or an RCX object.
updateCartesianLayout( x, cartesianLayout, replace = TRUE, stopOnDuplicates = FALSE, ... ) ## S3 method for class 'CartesianLayoutAspect' updateCartesianLayout( x, cartesianLayout, replace = TRUE, stopOnDuplicates = FALSE, ... ) ## S3 method for class 'RCX' updateCartesianLayout( x, cartesianLayout, replace = TRUE, stopOnDuplicates = FALSE, checkReferences = TRUE, ... )
x |
RCX or |
cartesianLayout |
|
replace |
logical; if existing values are updated (or ignored) |
stopOnDuplicates |
logical; whether to stop, if duplicates in |
... |
additional parameters |
checkReferences |
logical; whether to check if references to other aspects are present in the RCX object |
Networks, or more precisely its nodes may have a cartesian layout, that is represented as CartesianLayout object.
CartesianLayout objects can be added to an RCX or an other CartesianLayout object.
In the case, that a CartesianLayout object is added to an other, or the RCX object already contains a
CartesianLayout object, some attributes might be present in both. By default, the properties are updated with the values
of the latest one. This can prevented by setting the replace parameter to FALSE, in that case only new properties are added and
the existing properties remain untouched.
Furthermore, if duplicated properties are considered as a preventable mistake, an error can be raised by setting stopOnDuplicates
to TRUE. This forces the function to stop and raise an error, if duplicated properties are present.
CartesianLayoutAspect or RCX object with added layout
## For CartesianLayoutAspects:
## prepare some aspects:
cartesianLayout = createCartesianLayout(
node=c(0, 1),
x=c(5.5, 110.1),
y=c(200.3, 210.2),
z=c(-1, 3.1),
)
## node 0 is updated, new view is added
cartesianLayout2 = createCartesianLayout(
node=c(0, 0),
x=c(5.7, 7.2),
y=c(98, 13.9),
view=c(NA, 1476)
)
## Simply update with new values
cartesianLayout3 = updateCartesianLayout(cartesianLayout, cartesianLayout2)
## Ignore already present keys
cartesianLayout3 = updateCartesianLayout(cartesianLayout, cartesianLayout2,
replace=FALSE)
## Raise an error if duplicate keys are present
try(updateCartesianLayout(cartesianLayout, cartesianLayout2,
stopOnDuplicates=TRUE))
## =>ERROR:
## Provided IDs (node, view) countain duplicates!
## For RCX:
## prepare RCX object:
nodes = createNodes(name = c("a","b"))
edges = createEdges(source = 0, target = 1)
cySubNetworks = createCySubNetworks(
id = 1476,
nodes = "all",
edges = "all"
)
rcx = createRCX(nodes,
edges = edges,
cySubNetworks=cySubNetworks)
## add the network attributes
rcx = updateCartesianLayout(rcx, cartesianLayout)
## add additional network attributes and update existing
rcx = updateCartesianLayout(rcx, cartesianLayout2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.