add_zero: Prepend zero(s) to a number

View source: R/add_zero.R

add_zeroR Documentation

Prepend zero(s) to a number

Description

Prepend one or more 0's to a number. Useful for alphabetizing facto levels named with numbers.

Usage

add_zero(x, n)

Arguments

x

The vector to be modified

n

The number of characters that the resulting vector should have

Value

A character vector of identical length to x in which all elements have n characters (or more, for those which already had more prior to processing)


databrew/bohemiase documentation built on Nov. 2, 2022, 4:58 p.m.