is.round: Checks if information is lost by rounding

View source: R/helpers.R

is.roundR Documentation

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

is.round(1:5)

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

NickCH-K/vtable documentation built on Oct. 20, 2023, 4:35 a.m.