Create desnsity plots for all quantitative variables in a data frame.
densities(data, fill = "deepskyblue2", adjust = 1)
data frame
fill color for density plots
a factor multiplied by the smoothing bandwidth. See details.
a ggplot graph
The densities
function will only plot quantitative variables from
a data frame. Categorical variables are ignored.
The adjust
parameter mulitplies the smoothing parameter. For example
adjust = 2
will make the density plots twice as smooth.
The adjust = 1/2
will make the density plots half as smooth (i.e., twice as spiky).
densities(cars74)
densities(cars74, adjust=2)
densities(cars74, adjust=1/2)