# Sample Gamma distribution in R [closed]

I’m doing a programming assignment on sample gamma distributions in R. I used a loop to create histograms of a total of 49 different samples, each with different parameters. I was then asked to compare the theoretical mean and variance to the sample mean and variance for each of the 49 cases. I used a loop to create vectors of each of the sample means etc. However, I am getting answers such as (1.0e+00) where in this case, the answer should just be one. How do I solve this problem? I hope Ive given enough information and am making sense, if not I can clarify further, I have never done any probability programming so I’m relatively new to it.

• Is this a formatting issue? 1.0e+00 means $1 \times 10^0$ and that is $1$ – Henry Mar 19 '20 at 15:08

The part after the e is the exponent of 10, so $$10^{0}$$, and you need to multiply that by the part before the e. This yields $$1 \times 1.0 = 1$$, as you expected.
As described here on Stack Overflow (and in the other answer), you can disable it with options(scipen = 999) and it's possible to put that in your .Rprofile file so it becomes the default for you.
options(scipen = 9999)