Round Dataframe

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.


roundyh

Implement a simple rounding function. The default round function in R uses the IEC 60559 standard therefore it rounds 0.5 to 0 and round -1.5 to -2. The roundx rounding function accounts for this and helps to round 0.5 up.

Installation

You can install the development version of roundyh like so:

install.packages('roundyh')

Example

Round Number

library(roundyh)
roundx(10.111, 1)
#> [1] 10.1

Round Dataframe

roundx_df(data.frame(c(1.111, 1, 1.11), c(1, 1, 1), c("a", "b", "c")), 1)
#>   c.1.111..1..1.11. c.1..1..1. c..a....b....c..
#> 1               1.1          1                a
#> 2               1.0          1                b
#> 3               1.1          1                c

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("roundyh")

0.1.0 by Duan Yuanheng, 3 years ago


Browse source code at https://github.com/cran/roundyh


Authors: Duan Yuanheng [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests spelling, testthat


See at CRAN