Learn R Programming

vtable (version 1.2.6)

is.round: Checks if information is lost by rounding

Description

This function takes a vector and checks if any information is lost by rounding to a certain number of digits.

Usage

is.round(x, digits = 0)

Arguments

x

A vector.

digits

How many digits to round to.

Details

Returns TRUE if rounding to digits digits after the decimal can be done without losing information.

Examples

Run this code
# NOT RUN {
is.round(1:5)

x <- c(1, 1.2, 1.23)
is.round(x)
is.round(x,digits=2)
# }

Run the code above in your browser using DataLab