+5 votes
in Programming Languages by (40.5k points)
When I print some big numeric value in R, it is printed in the exponential form (e.g.  1.3273e+09).

How can I display the full number?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

To disable scientific notation in R, you can run the following:

options(scipen = 999)

Then you can print the whole number instead of its exponential form.

You can also use format() with scientific=FALSE. It will return a string that can be cast to numeric.

Here is an example:

> options(scipen = 999)
> a=1.4343e10
> a
[1] 14343000000
> as.numeric(format(a,scientific = FALSE))
[1] 14343000000
>


...