# rnorm() Function in R

rnorm() function returns a random set of normally distributed numbers with a specified mean and standard deviation.

#### Syntax

``rnorm(n, mean, sd)``

#### Arguments

• n = the number of random numbers to return
• mean = mean of the random numbers
• sd = standard deviation of the random numbers

The mean and sd arguments are optional. If you do not pass a value to them, they will take the default values as mean = 0 and sd = 1.

### Example 1: rnorm() function with default arguments

``````#random 8 numbers
rnorm(8)``````

#### Output

``[1] -3.67075752 0.25787427 0.08390619 -0.61299033 -0.18415307 0.27384653 1.03770411 0.67303186``

In the above example, the rnorm() assumes the mean = 0 and sd = 1.

### Example 2: rnorm() function with specified arguments

``````#random 8 numbers with mean = 96 and sd = 2
rnorm(8,mean=96,sd=2)``````
``[1] 96.67825 98.07197 94.95878 91.66486 95.88317 97.20591 91.79518 93.85726``

Here, the function returns the random numbers with the specified mean and standard deviation.