vertexAttr2Size: Mapping a numeric vector to vertex sizes through a linear...

View source: R/func__networkAnalyser__vertexAttr2Size.R

vertexAttr2SizeR Documentation

Mapping a numeric vector to vertex sizes through a linear transformation

Description

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.

Usage

vertexAttr2Size(
  x,
  x.min = min(x),
  x.max = max(x),
  size.min = 15,
  size.max = 60
)

Arguments

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.

Value

A vector of sizes with a precision of two decimals each.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

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)


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.