is_diverging: Check if a vector diverges a value

View source: R/0_util.r

is_divergingR Documentation

Check if a vector diverges a value

Description

Whether or not a vector is a diverges a value, returns a logical. Used to help default a scale_color for ggplot2.

Usage

is_diverging(x, mid_pt = 0)

Arguments

x

A vector to check the divergence of.

mid_pt

A single number checking divergence from. Defaults to 0.

Value

Logical, whether or not x is a diverges mid_pt.

See Also

Other cheem utility: as_logical_index(), color_scale_of(), contains_nonnumeric(), is_discrete(), linear_tform(), logistic_tform(), problem_type(), rnorm_from(), sug_basis(), sug_manip_var()

Examples

library(cheem)

is_diverging(-10:10)
is_diverging(-10:-5)
is_diverging(mtcars$mpg, 25)
is_diverging(mtcars$mpg, 40)

cheem documentation built on Nov. 9, 2023, 1:08 a.m.