Description Usage Format References Examples
Results from an accelerated life test used to estimate the lifetime of four different circuit designs (lifetimes in thousands of hours)
1 |
A data frame with 26 observations on the following 2 variables:
lifetime (lifetimes in thousands of hours)
design (a factor with levels DesignI and DesignII)
Ugarte, M. D., Militino, A. F., and Arnholt, A. T. 2015. Probability and Statistics with R, Second Edition. Chapman & Hall / CRC.
1 2 3 4 5 6 7 8 9 10 11 | # ggplot2 approach
ggplot(data = CIRCUIT, aes(x = design, y = lifetime, fill = design)) + geom_boxplot() +
labs(x = "", y = "Lifetime in thousands of hours") + guides(fill = "none") +
scale_fill_brewer()
ggplot(data = CIRCUIT, aes(x = design, y = lifetime, fill = design)) + geom_violin() +
labs(x = "", y = "Lifetime in thousands of hours") + guides(fill = "none") +
scale_fill_brewer()
# Reorder the boxplots by medians
ggplot(data = CIRCUIT, aes(x = reorder(design, lifetime, FUN = median), lifetime,
fill = design)) + geom_boxplot() + labs(x = "", y = "Lifetime in thousands of hours") +
guides(fill = "none") + scale_fill_brewer()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.