thickness: Thickness (datatype)

View source: R/thickness.R

thicknessR Documentation

Thickness (datatype)

Description

A representation of the thickness of a slab: a scaled value (x) where 0 is the base of the slab and 1 is its maximum extent, and the lower (lower) and upper (upper) limits of the slab values in their original data units.

Usage

thickness(x = double(), lower = NA_real_, upper = NA_real_)

Arguments

x

<coercible-to-numeric> A numeric vector or an object coercible to a numeric (via vctrs::vec_cast()) representing scaled values to be converted to a thickness() object.

lower

<numeric> The original lower bounds of thickness values before scaling. May be NA to indicate that this bound is not known.

upper

<numeric> The original upper bounds of thickness values before scaling. May be NA to indicate that this bound is not known.

Details

This datatype is used by scale_thickness_shared() and subscale_thickness() to represent numeric()-like objects marked as being in units of slab "thickness".

Unlike regular numeric()s, thickness() values mapped onto the thickness aesthetic are not rescaled by scale_thickness_shared() or geom_slabinterval(). In most cases thickness() is not useful directly; though it can be used to mark values that should not be rescaled—see the definitions of stat_ccdfinterval() and stat_gradientinterval() for some example usages.

thickness objects with unequal lower or upper limits may not be combined. However, thickness objects with NA limits may be combined with thickness objects with non-NA limits. This allows (e.g.) specifying locations on the thickness scale that are independent of data limits.

Value

A vctrs::rcrd of class "ggdist_thickness" with fields "x", "lower", and "upper".

Author(s)

Matthew Kay

See Also

The thickness aesthetic of geom_slabinterval().

scale_thickness_shared(), for setting a thickness scale across all geometries using the thickness aesthetic.

subscale_thickness(), for setting a thickness sub-scale within a single geom_slabinterval().

Examples

thickness(0:1)
thickness(0:1, 0, 10)

mjskay/ggdist documentation built on Nov. 21, 2024, 10:46 a.m.