align.decimal: Format Numeric Vectors Specially

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Format a numeric vector so that decimal mark is a constant distance from the end or beginning of each element.

Usage

1
2
align.decimal(x, decimal.mark = ".", ...)
padded(x,width = 4,...)

Arguments

x

numeric

decimal.mark

character indicating decimal

width

numeric indicating total digits

...

ignored

Details

for align.decimal, each element is formatted separately using prettyNum, then the character results are padded with spaces on the right, so that the decimals align. Whole numbers without the decimal mark get an extra space in its place.

For padded, x (numeric) is formatted with zero decimal places, no decimal, and enough leading zeros to ensure width width.

Value

character

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

1
2
align.decimal(c(.12, 1.2, 12.0))
padded(c(1,10,100,1000),5)

metrumrg documentation built on May 2, 2019, 5:55 p.m.