Search code examples
rexponential

Display way too small results in R


Sometimes, I will have to estimate the exponential notation(here, I mean to estimate b of a*e^b) of a number way too small. For example,

> 1-pnorm(30)
[1] 0

Because the result is too small, I tried options() with parameters scipen and digits and failed. Neither tweaks worked.


Solution

  • Just avoid using `1-pnorm':

    pnorm(30,lower.tail=FALSE)
    [1] 4.906714e-198