add_density: Add a density curve to a plot

View source: R/layer.R

add_densityR Documentation

Add a density curve to a plot

Description

For example, a plot a normal density over a histogram of conditional weighted residuals.

Usage

add_density(
  fun = dnorm,
  col = pm_opts$density.col,
  lwd = pm_opts$density.lwd,
  lty = pm_opts$density.lty,
  ...
)

layer_dnorm(x, sd = 1, mean = 0, ...)

Arguments

fun

passed to ggplot2::stat_function

col

passed to ggplot2::stat_function

lwd

passed to ggplot2::stat_function

lty

passed to ggplot2::stat_function

...

passed to ggplot2::stat_function

x

a ggplot object to which the density line will be added

sd

passed to stats::dnorm

mean

passed to stats::dnorm


metrumresearchgroup/pmplots documentation built on Oct. 15, 2024, noon