fixWidth: fixed width numeric/integer to character conversion

View source: R/fixWidth.R

fixWidthR Documentation

fixed width numeric/integer to character conversion

Description

this function is a wrapper around a sprintf call for numeric and integer values (I seem to be unable to memorise the sprintf call, hence the wrapper).

Usage

fixWidth(x, n = 1L)

Arguments

x

a numeric or integer vector

n

the width (nchar) of the resulting character

Value

A character vector of length x

Author(s)

Tim Appelhans

Examples

fixWidth(1, 2)
fixWidth(c(1, 20, 300, 4000, 50000), 5)


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.