Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not display number as exponent?

Tags:

r

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?

like image 393
LostLin Avatar asked Oct 18 '11 15:10

LostLin


People also ask

Why is Excel changing my numbers to exponents?

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.

Why it is showing E+ in Excel?

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.

How do you change an exponential to a 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.


1 Answers

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.

like image 114
IRTFM Avatar answered Sep 19 '22 01:09

IRTFM