run-if vs. r-unif
In R, there is a function called runif
.
At the beginning, I thought it were about running some code under some condition like the if-else statement.
Acutally, runif
is to generate random sample from uniform distribution.
> runif(10)
[1] 0.5942368 0.1305630 0.7846397 0.4326870 0.2199005 0.8692053 0.3500036
[8] 0.9567366 0.3755901 0.8445254
Similarly, there is rpois
, rnorm
, rbeta
, etc. for other distribution types.
Tags:
R,