
Convert numeric ternary outcomes into a factor
outcome2factor(x, n.levels = 3L)threshold2factor(x, n.levels = 3L, threshold = 0)
a numeric vector of -1, 0, and +1 values, indicating downregulation, uncertain response or upregulation, or a numeric vector that can be converted into such values using a pair of thresholds.
numeric Number of levels to create, either 3 or 2.
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"
.
Other Functions for quadrant and volcano plots: FC_format
,
geom_quadrant_lines
,
scale_colour_outcome
,
scale_shape_outcome
,
scale_y_Pvalue
,
stat_quadrant_counts
,
xy_outcomes2factor
Other scales for omics data: scale_shape_outcome
,
scale_x_logFC
,
xy_outcomes2factor
# NOT RUN {
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))
# }
Run the code above in your browser using DataLab