Package 'roundyh'

Title: Round Dataframe
Description: A simple rounding function. The default round() function in R uses the IEC 60559 standard and therefore it rounds 0.5 to 0 and rounds -1.5 to -2. The roundx() function accounts for this and helps to round 0.5 up to 1.
Authors: Duan Yuanheng [aut, cre, cph]
Maintainer: Duan Yuanheng <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-02-25 04:15:29 UTC
Source: https://github.com/cran/roundyh

Help Index


A rounding function

Description

A rounding function

Usage

roundx(n, dp)

Arguments

n

a number to round

dp

decimal place to round to

Value

rounded number

Examples

roundx(10.111, 1)

Applying the rounding function to all numeric values of dataframe while excluding characters

Description

Applying the rounding function to all numeric values of dataframe while excluding characters

Usage

roundx_df(df, dp)

Arguments

df

a dataframe

dp

decimal place to round to

Value

a dataframe

Examples

roundx_df(data.frame(c(1.111, 1, 1.11), c(1, 1, 1), c("a", "b", "c")), 1)