ggpmisc (version 0.3.2)

scale_shape_outcome: Shape scale for ternary outcomes

Description

Manual scales for colour and fill aesthetics with defaults suitable for the three way outcome from some statistical tests.

Usage

scale_shape_outcome(..., name = "Outcome", ns.shape = "circle filled",
  up.shape = "triangle filled", down.shape = "triangle down filled",
  de.shape = "square filled", na.shape = "cross")

Arguments

...

other named arguments passed to scale_manual.

name

The name of the scale, used for the axis-label.

ns.shape, down.shape, up.shape, de.shape

The shapes to use for each of the three possible outcomes.

na.shape

Shape used for NA.

Details

These scales only alter the values, and na.value default arguments of scale_shape_manual(). Please, see documentation for scale_manual for details.

See Also

Other Functions for quadrant and volcano plots: FC_format, geom_quadrant_lines, outcome2factor, scale_colour_outcome, scale_y_Pvalue, stat_quadrant_counts, xy_outcomes2factor

Other scales for omics data: outcome2factor, scale_x_logFC, xy_outcomes2factor

Examples

Run this code
# NOT RUN {
set.seed(12346)
outcome <- sample(c(-1, 0, +1), 50, replace = TRUE)
my.df <- data.frame(x = rnorm(50),
                    y = rnorm(50),
                    outcome2 = outcome2factor(outcome, n.levels = 2),
                    outcome3 = outcome2factor(outcome))

ggplot(my.df, aes(x, y, shape = outcome3)) +
  geom_point() +
  scale_shape_outcome() +
  theme_bw()

ggplot(my.df, aes(x, y, shape = outcome3)) +
  geom_point() +
  scale_shape_outcome(guide = FALSE) +
  theme_bw()

ggplot(my.df, aes(x, y, shape = outcome2)) +
  geom_point(size = 2) +
  scale_shape_outcome() +
  theme_bw()

ggplot(my.df, aes(x, y, shape = outcome3, fill = outcome2)) +
  geom_point() +
  scale_shape_outcome() +
  scale_fill_outcome() +
  theme_bw()

ggplot(my.df, aes(x, y, shape = outcome3, fill = outcome2)) +
  geom_point() +
  scale_shape_outcome(name = "direction") +
  scale_fill_outcome(name = "significance") +
  theme_bw()

# }

Run the code above in your browser using DataLab