skel_range: Skeleton for a range of numbers

View source: R/skeletons.R

skel_rangeR Documentation

Skeleton for a range of numbers

Description

skel_range() is a vectorized function. Use it to make multiple range from, say, data-frame columns. skel_range_pair() is the unvectorized function. Use it to make a single range from a vector (pair) of two numbers.

skel_range() is a vectorized function. Use it to make multiple range from, say, data-frame columns. skel_range_pair() is the unvectorized function. Use it to make a single range from a vector (pair) of two numbers.

Usage

skel_range_pair(x, skeleton = "{x[1]}–{x[2]}")

skel_range(xs, ys, skeleton = "{xs}–{ys}")

Arguments

x

a vector of two elements to plug into the range

skeleton

glue-style format to fill. defaults to "{xs}–{ys}" for skel_range() and "{x[1]}–{x[2]}" for skel_range_pair().

xs

a vector of the first elements in the range

ys

a vector of the second elements in the range

Details

These functions are wrappers around calls to glue::glue().

These functions are wrappers around calls to glue::glue().

Value

strings representing ranges

strings representing ranges

Examples

skel_range(c(.1, .2), c(.3, .4))
skel_range_pair(c(.1, .3))
skel_range(c(.1, .2), c(.3, .4))
skel_range_pair(c(.1, .3))

tjmahr/printy documentation built on March 4, 2024, 1:25 a.m.