lead0: Add Leading 0s to A Number

Description Usage Arguments Examples

View source: R/lead0.R

Description

This function will add leading 0s to a number to the values in a vector of numbers. The result will be a character string or vector of character strings.

Usage

1
lead0(vect, len)

Arguments

vect

Either a numeric value or a vector of numeric values to which you want to add leading 0s len The length you want each value to have after leading 0s are added. For example, if every number in a vector should be 10 characters long, the function will add 1 leading 0 to 123456789, but 5 leading 0s to 12345.

Examples

1
2
3
lead0(12345, len = 10)
lead0(ids, len = 20)
lead0(sales$product_id, len = 15)

spenceredwin/sqlWriteR documentation built on Sept. 13, 2019, 1:36 p.m.