View source: R/pipeline_functions.R
z2col | R Documentation |
z2col
is a helper function in out2excel
. It defines the color scale of the Z statistics value.
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]
)
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]. |
Return a vector of color codes.
t1 <- sort(rnorm(mean=0,sd=2,n=100))
graphics::image(as.matrix(t1),col=z2col(t1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.