round_text: Converting Numeric Values into Characters with the Same...

Description Usage Arguments Examples

View source: R/round_text.R

Description

This simple function is to facilitate something like decimal horizontal adjustment which demands each value has the same digits after the decimal point.

Usage

1
round_text(x, digits = 2, na = NULL)

Arguments

x

a vector of numeric values.

digits

digits which is to be passed to round. It should not be smaller than 0.

na

how to show NAs. The default is to show " NA", however, you can change it to "NA" or simply NA.

Examples

1
2
v=c(3, 3.1, 3.456, 3.452, 3.77, NA, 0, 10.56332)
res=round_text(v, 2, na=NA)

plothelper documentation built on July 2, 2020, 4:03 a.m.