RDJ - 8 months ago 64

R Question

I want to create two different vectors of data which are normal distributions. One which has a a mean value of 0 and variance of 1; one which has a mean value of 0 and variance of 0.25.

Can this be done with

`rnorm`

Answer

Of course. Type `?rnorm`

into the console to learn more about it. I'm assuming you want vectors with 100 numbers, but just change `n`

if you want.

```
vector1 = rnorm(n = 100, mean = 0, sd = sqrt(1))
vector2 = rnorm(n = 100, mean = 0, sd = sqrt(0.25))
```

Source (Stackoverflow)