Learn R Programming

NetPathMiner (version 1.8.0)

colorVertexByAttr: Computes colors for vertices according to their attributes.

Description

This function returns a list of colors for vertices, assigned similar colors if they share a common attribute (ex: in the same pathway, etc).

Usage

colorVertexByAttr(graph, attr.name, col.palette = palette())

Arguments

graph
An annotated igraph object.
attr.name
The attribute name (ex: "pathway") by which vertices will be colored. Complex attributes, where a vertex belongs to more than one group, are supported.
col.palette
A color palette, or a palette generating function (ex:
col.palette=rainbow
).

Value

A list of colors (in HEX format) for vertices.

See Also

Other Plotting methods: layoutVertexByAttr; plotAllNetworks; plotClassifierROC; plotClusterMatrix, plotClusterProbs, plotClusters; plotCytoscape, plotCytoscapeGML; plotNetwork; plotPathClassifier; plotPaths

Examples

Run this code
data("ex_kgml_sig")
  v.colors <- colorVertexByAttr(ex_kgml_sig, "pathway")
  plotNetwork(ex_kgml_sig, vertex.color=v.colors)

Run the code above in your browser using DataLab