View source: R/plot-failure-modes.R
geom_jitter_failure_mode | R Documentation |
The geom_jitter_failure_mode
is very similar to
ggplot2::geom_jitter()
except that a failure mode variable specified
as the color and/or shape aesthetic is parsed to separate multiple
failure modes and plot them separately. For example, if an observation
has the failure mode "LAT/LAB", two points will be plotted, one with the
failure mode "LAT" and the second with the failure mode "LAB".
geom_jitter_failure_mode(
mapping = NULL,
data = NULL,
stat = "identity",
position = "jitter",
...,
width = NULL,
height = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
sep = "[/, ]+"
)
mapping |
Set of aesthetic mapping created by |
data |
The data to be displayed by this layer.
See |
stat |
The statistical transformation to use on the data for this layer.
See |
position |
A position adjustment to use on the data for this layer.
See |
... |
Other arguments passed on to |
width |
The amount of horizontal jitter.
See |
height |
The amount of vertical jitter.
See |
na.rm |
If FALSE, the default, missing values are removed with warning.
See |
show.legend |
|
inherit.aes |
if FALSE, overrides the default aesthetics.
See |
sep |
A regular expression indicating the character(s) separating
multiple failure modes. By default |
The variable specified for the aesthetics shape
and color
are passed
to the function separate_failure_modes()
to parse the failure modes and
separate multiple failure modes separated by character(s) specified in
the regular expression given in the parameter sep
. By default, multiple
failure modes are expected to be separated by spaces, commas or forward
slashes, but this can be overridden.
If both shape
and color
aesthetics are specified, both must be identical.
separate_failure_modes()
ggplot2::geom_jitter()
library(dplyr)
library(ggplot2)
carbon.fabric.2 %>%
filter(test == "WT") %>%
ggplot(aes(x = condition, y = strength)) +
geom_boxplot() +
geom_jitter_failure_mode(aes(color = failure_mode, shape = failure_mode))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.