Learn R Programming

pathRender (version 1.34.0)

colorNodes: attach node coloring information to a graphNEL instance

Description

attach node coloring information to a graphNEL instance

Usage

colorNodes(g, nodeAss, pal, attgen)

Arguments

g
graphNEL instance
nodeAss
color map for nodes: vector with elements evaluating to colors and nodes as element names
pal
a palette (use colorRampPalette for color interpolation)
attgen
attribute generating function -- pwayRendAttrs is prototype

Value

a graphNEL instance with additional rendering data

Examples

Run this code
example(randomGraph)
nn = nodes(g1)
x = runif(length(nn))
names(x) = nn
h1 = colorNodes(g1, x, colorRampPalette(brewer.pal(9, "Blues"))(length(nn)),
 pwayRendAttrs)
h1

Run the code above in your browser using DataLab