padded {PolyHaplotyper}R Documentation

pad an integer (prefix with zeroes to a fixed length)

Description

pad an integer (prefix with zeroes to a fixed length)

Usage

padded(x, maxx=0)

Arguments

x

vector of non-negative integers

maxx

a single integer to whose nchar all x elements will be padded; if 0 (default) the largest value in x will be used

Value

a character vector representing the values of x left-padded with 0's to the length of integer maxx or of max(x)

Examples

padded(c(21, 1, 121, NA, 0))
padded(c(21, 1, 121, NA, 0), maxx=1000)

[Package PolyHaplotyper version 1.0.1 Index]