compute_density_limits: Compute density limits

Description Usage Arguments Details Value

View source: R/density.R

Description

Drawing a nice density plot that goes to zero can be challenging. This function guesses a set of limits for that purpose.

Usage

1
compute_density_limits(x, limits = NULL, bw = "nrd0", cut = 3, trim = TRUE)

Arguments

x

Numeric vector of points to estimate density for.

limits

Numeric vector of length two, specifying the limits of density estimation allowed.

bw

Bandwidth for density (default is nrd0).

cut

A multiple of estimated bandwidth past the range of the data to use (default 3).

trim

Should the density limits be trimmed per limits?

Details

Creating a density plot is a great way to see data distributions. However, it can be confusing to see a plot that abruptly ends at a particular point, rather than going to zero. of course, it may be the case that with no data to estimate how a distribution goes to zero it can also confusing.

This function is designed to come up with

Value

A numeric vector of length 2 representing the min and max limits for density estimation.


steveneschrich/densityplots documentation built on Dec. 23, 2021, 5:32 a.m.