roundSim: Rounding values for presentation

Description Usage Arguments Value See Also Examples

View source: R/roundSim.R

Description

roundSim takes a vector or data.frame object and returns the same type of object, but rounded.

Usage

1
roundSim(x, digits = 3, percent = FALSE)

Arguments

x

A vector or data.frame object.

digits

An integer value indicating the number of digits to round to.

percent

A boolean value indicating whether column elements should be multiplied by 100.

Value

A vector or data.frame object.

See Also

SimDisplay

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(Brown1974)
roundSim(Brown1974) # returns error
roundSim(Brown1974[,4:9]) # dataframe input, dataframe output
str(roundSim(Brown1974[,4:9])) # vectors are now character-type
roundSim(Brown1974[,4:9], 2)

set.seed(10)
dat <- rnorm(n = 5, mean = 0, sd = 150) # Wider range, vector input
roundSim(dat) # vector output

## End(Not run)

mattsigal/SimDisplay documentation built on May 21, 2019, 1:25 p.m.