value2col.Rd
Converts ranges of values to corresponding color along color gradient, specified by 3 colors (low color, middle color and high color)
value2col(
values,
limit = NULL,
gradient.length = 100,
low.col = "skyblue",
mid.col = "grey",
high.col = "tomato"
)
numeric specifying limit of color range. If unspecified, limit <- max(c(abs(min(Values)), abs(max(Values))))
Numeric specifying number of bins to split gradient into. Default is 100.
Color representing low values. Default is "skyblue"
Color representing mid values. Default is "grey"
Color representing high values. Default is "tomato"
vector of numerical values to convert to colors
vector of colors.
# get edge colors
col.lim <- max(c(abs(min(vis.links$value)), abs(max(vis.links$value))))
#> Error in eval(expr, envir, enclos): object 'vis.links' not found
edge.colors <- value2col(vis.links$value, limit = col.lim)
#> Error in value2col(vis.links$value, limit = col.lim): could not find function "value2col"