| 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: | 2026-05-24 10:01:59 UTC |
| Source: | https://github.com/cran/roundyh |
A rounding function
roundx(n, dp)roundx(n, dp)
n |
a number to round |
dp |
decimal place to round to |
rounded number
roundx(10.111, 1)roundx(10.111, 1)
Applying the rounding function to all numeric values of dataframe while excluding characters
roundx_df(df, dp)roundx_df(df, dp)
df |
a dataframe |
dp |
decimal place to round to |
a dataframe
roundx_df(data.frame(c(1.111, 1, 1.11), c(1, 1, 1), c("a", "b", "c")), 1)roundx_df(data.frame(c(1.111, 1, 1.11), c(1, 1, 1), c("a", "b", "c")), 1)