+4 votes
in Programming Languages by (5.2k 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

0 votes
by (33.0k points)

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