Learn R Programming

SSBtools (version 0.8.0)

RoundWhole: Round values that are close two whole numbers

Description

Round values that are close two whole numbers

Usage

RoundWhole(x, digits = 9, onlyZeros = FALSE)

Arguments

x

vector or matrix

digits

parameter to round

onlyZeros

Only round values close to zero

Value

Modified x

Examples

Run this code
# NOT RUN {
x <- c(0.0002, 1.00003, 3.00014)
RoundWhole(x)     # No values rounded
RoundWhole(x, 4)  # One value rounded
RoundWhole(x, 3)  # All values rounded
RoundWhole(x, 3, TRUE)  # One value rounded
# }

Run the code above in your browser using DataLab