add_leading_zeroes {spatial.tools}R Documentation

Add Leading Zeroes to a Numeric Vector

Description

Appends leading zeroes to a vector of numbers based on a string length or a maximum number.

Usage

add_leading_zeroes(number, number_length, max_number)

Arguments

number

A numeric vector.

number_length

The length of the output string.

max_number

A number to base the length of the output string on.

Value

A character vector.

Author(s)

Jonathan A. Greenberg

Examples


x=c(1:10)
add_leading_zeroes(x,number_length=4)
add_leading_zeroes(x,max_number=10000)


[Package spatial.tools version 1.6.1 Index]