# 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