Home > Mobile >  How to treat or beautify R summary() output containing "e 02" (scientific notation) values
How to treat or beautify R summary() output containing "e 02" (scientific notation) values

Time:12-19

I'm new to R and wan't to learn what is a good way to treat "e 02" values. See this example output of a summary(lm()).

Coefficients:
                                              Estimate Std. Error t value Pr(>|t|)    
(Intercept)                                 -2.168e 02  4.402e 00 -49.257  < 2e-16 ***
Age                                          1.044e 01  8.403e-02 124.262  < 2e-16 ***
GenderWeiblich                               2.638e 02  6.131e 00  43.019  < 2e-16 ***
VerstorbenTrue                               1.027e 03  3.665e 01  28.020  < 2e-16 ***

Of course I know what that e means but I don't want to transform that in my head. I want to beautify the output.

Asking the other way around: Why does R use scientific notation at this point?

CodePudding user response:

In order to eliminate the exponential notation of the integer, we can use the

global setting using options() method, by setting the scipen argument, that is

options(scipen = n)
  •  Tags:  
  • r
  • Related