leading_zero: Add or remove leading zeros

View source: R/leading_zero.R

leading_zeroR Documentation

Add or remove leading zeros

Description

Add or remove leading zeros

Usage

leading_zero(x, z = NULL, mode = "add")

Arguments

x

Numeric or character vector

z

Number of significant digits of the resulting number with leading zeros (if NULL, it will be detected automatically)

mode

"add" or "remove" leading zero

Value

vector with (mode = "add) or without (mode = "remove") leading zeros

Examples

leading_zero(1:10, z=3)
leading_zero(c(1,10,100,1000,10000))
leading_zero(c("001", "1001", "g01", "0abc"), mode = "remove")


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.