Difference between rnorm() and runif()
We can understand the difference between the rnorm() and runif() functions in tabulated form as well.
Aspect |
rnorm() |
runif() |
---|---|---|
Distribution Type |
Normal |
Uniform |
Parameters |
n, mean, sd |
n, min, max |
Shape of Distribution |
Bell-shaped, symmetrical around the mean |
Flat, constant within the specified range |
Example |
rnorm(100, mean = 0, sd = 1) |
runif(100, min = 0, max = 1) |
The Difference Between rnorm() and runif() in R
While conducting statistical analysis we generate random numbers for reproducibility and experiments. R Programming Language provides two functions runif() and rnorm() to generate random functions. In this article, we will understand the difference between these two functions and how we can use them with the help of examples.
Contact Us