ggdensity: Plot a density distribution

Description Usage Arguments Value Examples

View source: R/ggdensity.R

Description

Plot a density distribution

Usage

1
ggdensity(data, variable, mapping = NULL, ...)

Arguments

data

A data frame

variable

Name of the variable to plot

mapping

A named list of arguments to ggplot2::aes_string, containing additional mappings

...

Parameters to be passed to ggplot2::geom_density

Value

A ggplot

A ggplot

Examples

1
2
3
mtcars$vs <- factor(mtcars$vs)
ggdensity(mtcars, "mpg")
ggdensity(mtcars, "mpg", mapping = list(fill = "vs"), alpha = 0.5)

rscherrer/ggsim documentation built on June 11, 2020, 2:22 p.m.