pad_integers: Pad Integers

View source: R/utils.R

pad_integersR Documentation

Pad Integers

Description

Takes in a numeric vector of integerish values and returns a character vector of the same length with padding. The width of padding can be specified or intuited from the maximum value. The padding flag can be configured.

Usage

pad_integers(x, width = NULL, flag = "0")

Arguments

x

A numeric vector of integerish values (i.e., either R integers or integer-like doubles). See rlang::is_integerish() for details.

width

Either NULL or a single integerish value specifying the width of padding to use. If NULL, the width of the maximum value in x is used (i.e., the minimum padding needed to standardize the width of all values).

flag

A string specifying what to pad x with. (default = "0")

Value

A character vector the same length as x but with padding added with the specifying width and flag.


jmgirard/tidymedia documentation built on June 15, 2024, 1:52 p.m.