I just trying to round in R number like:
> round(1.327076e-09)
I would like it to result in
> 1.33e-09
but results in
> 0
which function can use?
In order to eliminate the exponential notation of the integer, we can use the global setting using options() method, by setting the scipen argument, that is options(scipen = n).
Note that for rounding off a 5, the IEEE standard is used, ``go to the even digit''. Therefore round(0.5) is 0 and round(-1.5) is -2 . signif rounds the values in its first argument to the specified number of significant digits.
Try signif
:
> signif(1.326135235e-09, digits = 3)
[1] 1.33e-09
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With