View source: R/outcome2factor.r
| outcome2factor | R Documentation |
Convert numeric ternary outcomes into a factor
outcome2factor(x, n.levels = 3L)
threshold2factor(x, n.levels = 3L, threshold = 0)
x |
a numeric vector of -1, 0, and +1 values, indicating down-regulation, uncertain response or up-regulation, or a numeric vector that can be converted into such values using a pair of thresholds. |
n.levels |
numeric Number of levels to create, either 3 or 2. |
threshold |
numeric vector Range enclosing the values to be considered uncertain. |
These functions convert the numerically encoded values into a factor
with the three levels "down", "uncertain" and "up", or
into a factor with two levels de and uncertain as expected by
default by scales scale_colour_outcome,
scale_fill_outcome and scale_shape_outcome.
When n.levels = 2 both -1 and +1 are merged to the same level of the
factor with label "de".
These are convenience functions that only save some typing. The same
result can be achieved by a direct call to factor and
comparisons. These functions aim at making it easier to draw volcano and
quadrant plots.
Other Functions for quadrant and volcano plots:
FC_format(),
scale_colour_outcome(),
scale_shape_outcome(),
scale_y_Pvalue(),
xy_outcomes2factor()
Other scales for omics data:
scale_colour_logFC(),
scale_shape_outcome(),
scale_x_logFC(),
xy_outcomes2factor()
outcome2factor(c(-1, 1, 0, 1))
outcome2factor(c(-1, 1, 0, 1), n.levels = 2L)
threshold2factor(c(-0.1, -2, 0, +5))
threshold2factor(c(-0.1, -2, 0, +5), n.levels = 2L)
threshold2factor(c(-0.1, -2, 0, +5), threshold = c(-1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.