set_n.colors.range: Set Number of Colors Used in Heatmaps

View source: R/params_functions.R View source: R/Package-Code5-Compiled.R

set_n.colors.rangeR Documentation

Set Number of Colors Used in Heatmaps

Description

A necessary parameter for the generation of heatmaps with custom breaks and color scale as is done in myHeatmap and myHeatmapByAnnotation. See note for how this is used.

Usage

set_n.colors.range(n)

Arguments

n

a single numeric

Details

this value is used in creating breaks and color scale for heatmaps. A sequence is created along the scale range set by set_scale.range of length n.colors.range set in this function. n.colors.range - 1 colors will then be use to generate the colors in the heatmap. (See notes for the code where this is used). Default is n = 100

Please see params for more information about accessing and setting up these variables.

Note

In myHeatmap and myHeatmapByAnnotation, breaks and colors are set using these and other parameters. breaks <- seq(params$scale.range[1], params$scale.range[2],length.out=params$n.colors.range) my_cols=colorRampPalette(params$scale.colors)(n=params$n.colors.range-1)

Author(s)

~~Alison Moss~~

See Also

set_scale.range and set_scale.colors

Examples

##initiate parameters
initiate_params()

#view heatmap with default
myHeatmap(RAGP_norm)

##set range to desired and view difference
set_n.colors.range(n = 5)
myHeatmap(RAGP_norm)


axm323/dataVisEasy documentation built on Feb. 1, 2024, 11:53 p.m.