dbox
is a package for visualizing continuous distributions with a
combined kernel density plot and box plot. This allows for a
simultaneous view of overall distribution shape in the density plot as
well as important quantiles and extreme values in the box plot. Box plot
outliers are jittered to improve outliers density visualization. An
optional density plot of an idealized normal distribution with the same
parameters is also available for comparison.
You can install dbox with: devtools::install_github('hwkmth/dbox')
and
use help(dbox)
for more information.
library(dbox)
ndensity <- rnorm(5000)
dbox(ndensity)
rskew <- 1.5^rnorm(5000) * 5
dbox(rskew, color = "orange2", fill = FALSE,
normal = TRUE, color_norm = "steelblue2")
diamonds <- ggplot2::diamonds
diamonds$lprice <- log(diamonds$price)
dbox(diamonds$lprice[diamonds$cut == "Ideal"],
label = "Log Price: Ideal Cut Diamonds",
color = "orange2",
normal = TRUE,
color_norm = "steelblue2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.