paddedFloatToChar: Convert numeric to character with padding

Description Usage Arguments Value Author(s) Examples

View source: R/misc-methods.R

Description

Convert numeric to character with padding

Usage

1
paddedFloatToChar(x, padL = ceiling(log10(x + 1)), padR = 3, pad = "0")

Arguments

x

numeric. Number to be converted to character with padding

padL

numeric. Desired number of digits on left side of decimal. If not enough, pad will be used to pad.

padR

numeric. Desired number of digits on right side of decimal. If not enough, pad will be used to pad.

pad

character to use as padding (nchar(pad)==1 must be TRUE). Passed to str_pad

Value

Character string representing the filename.

Author(s)

Eliot McIntire and Alex Chubaty

Examples

1
2
paddedFloatToChar(1.25)
paddedFloatToChar(1.25, padL = 3, padR = 5)

SpaDES documentation built on May 19, 2017, 2:09 p.m.

Search within the SpaDES package
Search all R packages, documentation and source code