ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line()
# ggplot(faithful, aes(y = waiting)) +
# stat_distrmix_line(orientation = "y")
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(components = "sum")
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(components = "members")
ggplot(faithful, aes(x = waiting)) +
geom_histogram(aes(y = after_stat(density)), bins = 20) +
stat_distrmix_line(aes(colour = after_stat(component),
fill = after_stat(component)),
geom = "area", linewidth = 1, alpha = 0.25, se = FALSE)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(aes(colour = after_stat(component),
fill = after_stat(component)),
geom = "area", linewidth = 1, alpha = 0.25,
components = "members", se = FALSE)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(geom = "area", linewidth = 1, alpha = 0.25,
colour = "black", outline.type = "upper",
components = "sum", se = FALSE)
# special case of no mixture
ggplot(subset(faithful, waiting > 66), aes(x = waiting)) +
stat_distrmix_line(k = 1)
# Inspecting the returned data using geom_debug()
gginnards.installed <- requireNamespace("gginnards", quietly = TRUE)
if (gginnards.installed)
library(gginnards)
if (gginnards.installed)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(geom = "debug", components = "all")
if (gginnards.installed)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(geom = "debug", components = "sum")
if (gginnards.installed)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(geom = "debug", components = "members")
if (gginnards.installed)
ggplot(faithful, aes(x = waiting)) +
stat_distrmix_line(geom = "debug", fm.values = TRUE)
Run the code above in your browser using DataLab