I see a lot of articles about how to change the decimal precision in R. But is there some way to get R to display a whole number instead of showing something like 9e+08
?
In Microsoft Excel, large and small numbers are stored automatically into Scientific Notation by default. Excel has a number limit which is 15 digits. If your number digits are 15+ then, excel automatically converts that to scientific notation as a way of dealing with that limit.
This means the number in that cell is too large to display according to the width set by the column. There are several ways to handle this type of display problem: increase the width of the column, or decrease the font size of the cell's contents, or change the format of the number.
To enter a number in scientific notation use a carat ^ to indicate the powers of 10. You can also enter numbers in e notation. Examples: 3.45 x 10^5 or 3.45e5. Order of magnitude will also be identified for the calculated standard form.
I see you've been given a format
approach. Do realize that function returns a "character" value. If you wanted to globally change the behavior of your console session in favor of "whole numbers", then changing scipen option()
is the way to go.
> options("scipen" = 10) > options()$scipen [1] 10 > 9e+08 [1] 900000000
The value given to 'scipen' is not actually the threshold for exponent format but is rather a "bias" with larger positive numbers increasing the values printed in fixed notation.
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