broom (version 0.4.1)

tidy.density: tidy a density objet

Description

Given a "density" object, returns a tidy data frame with two columns: points x where the density is estimated, points y for the estimate

Usage

"tidy"(x, ...)

Arguments

x
an object of class "density"
...
extra arguments (not used)

Value

a data frame with "x" and "y" columnsd <- density(faithful$eruptions, bw = "sj") head(tidy(d))library(ggplot2) ggplot(tidy(d), aes(x, y)) + geom_line()

See Also

density