z2col: Set Color Scale for Z Statistics Value

View source: R/pipeline_functions.R

z2colR Documentation

Set Color Scale for Z Statistics Value

Description

z2col is a helper function in out2excel. It defines the color scale of the Z statistics value.

Usage

z2col(
  x,
  n_len = 60,
  sig_thre = 0.01,
  col_min_thre = 0.01,
  col_max_thre = 3,
  blue_col = brewer.pal(9, "Set1")[2],
  red_col = brewer.pal(9, "Set1")[1]
)

Arguments

x

a vector of numerics, a vector of Z statistics.

n_len

integer, number of unique colors. Default is 60.

sig_thre

numeric, the threshold for significance (absolute value of Z statistics). Z values failed to pass the threshold will be colored "white".

col_min_thre

numeric, the lower threshold for the color bar value. Default is 0.01.

col_max_thre

numeric, the upper threshold for the color bar value. Default is 3.

blue_col

a vector of characters, the blue colors used to show the negative Z values. Default is brewer.pal(9,'Set1')[2].

red_col

a vector of characters, the red colors used to show positive Z values. Default is brewer.pal(9,'Set1')[1].

Value

Return a vector of color codes.

Examples

t1 <- sort(rnorm(mean=0,sd=2,n=100))
graphics::image(as.matrix(t1),col=z2col(t1))

jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.