setNodeColorRule,RCyjs-method {RCyjs} | R Documentation |
setNodeColorRule
control node color via values of the specified attribute
## S4 method for signature 'RCyjs' setNodeColorRule(obj, attribute, control.points, colors, mode = c("interpolate", "lookup"))
obj |
an RCyjs instance |
attribute |
a character string, the node attribute category whose value controls color |
control.points |
a list of all possible values of the attribute |
colors |
the corresponding node color, one specified for each of the control.points |
mode |
a character string, either "interpolate" or "lookup" |
for interpolate mode, in which the node attribute should be a continusously varying numerical quantity in-between colors are calculated for in-between values. for lookup mode, in which the node attribute is a discrete string variable, simple color lookup is performed.
no return value
if(interactive()){ g <- simpleDemoGraph() rcy <- RCyjs(title="rcyjs demo", graph=g) layout(rcy, "cose") fit(rcy, 100) setNodeColorRule(rcy, "count", c(0, 100), c("green", "red"), mode="interpolate") redraw(rcy) }