jj_cap_vals: Cap values at the top/bottom of a vector by a threshold

View source: R/jj_cap_vals.R

jj_cap_valsR Documentation

Cap values at the top/bottom of a vector by a threshold

Description

Useful for plotting when there are few outlier values stretching the colour scale

Usage

jj_cap_vals(vec, cap_top = "q99", cap_bottom = NULL)

Arguments

vec

numeric vector

cap_top

cap values above this threshold, either a single number or a quantile as string, eg. 'q95' for quantile 95

cap_bottom

same as cap_top, but cap values below this threshold

Examples

jj_cap_vals(seq(0,100), cap_top='q95', cap_bottom=10)

mathosi/jj documentation built on Feb. 25, 2024, 2:29 p.m.