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.

Similar Reads

Difference between rnorm() and runif()

We can understand the difference between the rnorm() and runif() functions in tabulated form as well....

rnorm()

rnorm() is a popular function in R that generates random numbers using normal distribution. Normal distribution, also called Gaussian distribution, represents a bell-shaped curve with the maximum values clustered around the mean value. The Probability Density function of a normal distribution is given by:...

runif()

...