method_norm_1d {ggdensity}R Documentation

Univariate parametric normal HDR estimator

Description

Function used to specify univariate normal density estimator for get_hdr_1d() and layer functions (e.g. geom_hdr_rug()).

Usage

method_norm_1d()

Details

For more details on the use and implementation of the ⁠method_*_1d()⁠ functions, see vignette("method", "ggdensity").

Examples

# Normal estimators are useful when an assumption of normality is appropriate
df <- data.frame(x = rnorm(1e3))

ggplot(df, aes(x)) +
  geom_hdr_rug(method = method_norm_1d()) +
  geom_density()

# Can also be used with `get_hdr_1d()` for numerical summary of HDRs
res <- get_hdr_1d(df$x, method = method_norm_1d())
str(res)


[Package ggdensity version 1.0.0 Index]