leading.zeros: Add zeros in string representing a number

View source: R/clanToolsFunctions.R

leading.zerosR Documentation

Add zeros in string representing a number

Description

Add zeros when numbers occur in filenames and such 009 comes before 111 (cf. 9 vs. 111)

Usage

leading.zeros(c(9,111),3)

Arguments

x

is a vector of numeric values

digits

is the number of digits in the final results.

Value

The vecor of characters wher zeors have been added as necessary

Author(s)

Claus E. Andersen


claus-e-andersen/clanTools documentation built on June 2, 2024, 6:23 a.m.