View source: R/func__networkAnalyser__vertexAttr2Size.R
vertexAttr2Size | R Documentation |
This function generates vertex sizes for plotting networks based on a vertex attribute. It works in the same way as the Cytoscape in mapping continuous values to an attribute. This is a "smoother" way than simply multiply values with a constant.
vertexAttr2Size( x, x.min = min(x), x.max = max(x), size.min = 15, size.max = 60 )
x |
Input numeric vector to be transformed. |
x.min |
Minimum of x or the variable from which the x is drawn. |
x.max |
Maximum of x or the variable from which the x is drawn. |
size.min |
Minimal vertex size. |
size.max |
Maximal vertex size. |
A vector of sizes with a precision of two decimals each.
Yu Wan (wanyuac@126.com)
library(igraph) ... # network construction assoc <- findPhysLink(...) V(net)$size <- vertexAttr2Size(x = V(net)$n, x.min = 2, x.max = max(assoc[["mapping"]]$count), size.min = 15, size.max = 60)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.