Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many numbers after the decimal point can you show using R?

Tags:

r

I was wondering how far can you print this:

http://www.iheartchaos.com/post/16393143676/fun-with-math-dividing-one-by-998001-yields-a

In R.

e.g: 1/998001

like image 454
Tal Galili Avatar asked Jan 26 '12 21:01

Tal Galili


People also ask

How many digits after the decimal point should be reported?

A suitable rule specifies up to one decimal place and up to two significant digits. When comparing group means or percentages in tables, rounding should not blur the differences between them.

How do you round to 2 decimal places in R?

You can use the following functions to round numbers in R: round(x, digits = 0): Rounds values to specified number of decimal places. signif(x, digits = 6): Rounds values to specified number of significant digits.


1 Answers

You could use the mpc package,

# 3000 is the precision in bits
> mpc(1, 3000) / mpc(998001, 3000)
[1] "(1.0020030040050060070080 ...
...
like image 198
Owen Avatar answered Oct 01 '22 20:10

Owen