Learn R Programming

jjb (version 0.1.1)

pad_number: Pad Numeric Numbers

Description

Add zeros before start of the number

Usage

pad_number(x)

Arguments

x

A vector

Value

A character vector that is padded to the length of the maximum entry.

Examples

Run this code
# NOT RUN {
# Padding applied
pad_number(8:10)

# No padding applied
pad_number(2:3)

# Pads non-negative number with 0.
# This needs to be improved slightly...
pad_number(-1:1)
# }

Run the code above in your browser using DataLab