Lets say I have a data frame "example" of a bunch of random integers

example <- data.frame(Column1 = floor(runif(7, min = 1000, max = 7000)), column2 = floor(runif(7, min = 12000, max = 70000)))

I want to get a summary of the descriptive statistics of these columns so I use

stat.desc(example)

But the output of the descriptive statistics is in scientific notation form. I know I can do:

format(stat.desc(example), scientific = FALSE)

And it will convert it to non-scientific notation, but why is scientific notation the default output mode?

1

Best Answer


It is created that way. However, you can set the options:

options(scipen=100)options(digits=3)stat.desc(example)

This will produce output as you like without converting to decimals afterward. I've included rounding as it will likely be 6-7 digits without the rounding option. This would give you 3 decimal places and no scientific notation.