Learn R Programming

simplevis (version 6.4.0)

sv_density_max: Calculate the max density in a gg_density() plot.

Description

Calculate the max density in a gg_density() plot.

Usage

sv_density_max(
  data,
  x_var,
  model_bw = "nrd0",
  model_adjust = 1,
  model_kernel = "gaussian",
  model_n = 512,
  model_trim = FALSE
)

Arguments

data

A tibble or dataframe. Required input.

x_var

Unquoted numeric variable to be on the x scale. Required input.

model_bw

The bw argument of the stats::density function. Defaults to "nrd0".

model_adjust

The adjust argument of the stats::density function. Defaults to 1.

model_kernel

The kernel argument of the stats::density function. Defaults to "gaussian".

model_n

The n argument of the stats::density function. Defaults to 512.

model_trim

The trim argument of the stats::density function. Defaults to FALSE.