Learn R Programming

ggdensity (version 1.0.0)

method_norm_1d: 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()

Arguments

Details

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

Examples

Run this code
# 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)

Run the code above in your browser using DataLab