View source: R/geom_binomdensity.R
geom_binomdensity | R Documentation |
y
variablesAdd dot-densities for binary y
variables
geom_binomdensity(data, x, y, scale = "auto", ...)
data |
A dataframe. |
x, y |
Characters corresponding to the x and y axis. Note that |
scale |
Character specifying method of scaling the dot-densities. Can
be: |
... |
Other arguments passed to |
library(ggplot2) library(see) data <- iris[1:100, ] ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", fill = "red", color = NA ) # Different scales data[1:70, "Species"] <- "setosa" # Create unbalanced proportions ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "auto") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "density") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "proportion") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = list("setosa" = 0.4, "versicolor" = 0.6) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.