rounds: A function to round to a certain decimal but keep the zero as...

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

View source: R/rounds.R

Description

This function is used throughout multiple biostatrpts functions instead of the traditional round() function.

Usage

1
rounds(x, digits = 0, as.numeric = FALSE)

Arguments

x

A number or numeric vector whose digits will be rounded

digits

Number of decimal places to round to

as.numeric

If FALSE the number returned is a character string. If TRUE the number returned is numeric

Details

Embedded into multiple biostatrpts functions to round values neatly and have consistent reporting.

Value

A character or numeric string or vector

Author(s)

University of Wisconsin-Madison Biostatistics and Medical Informatics Department, Scott Hetzel M.S.

See Also

round()

Examples

1
2
3
4
5
#  See the difference in the print out of the two round functions for
#  rounding 0.0395 when rounding to 3 decimal places

rounds(0.0395, 3)
round(0.0395, 3)

jbirstler/biostatrpts documentation built on May 7, 2020, 12:10 a.m.