runif(
n,
min = 0,
max = 1)
R: The Uniform Distribution
rnorm(
n, # 分位数
mean = 0, # 平均値のベクトル
sd = 1) # 標準偏差のベクトル
R: The Normal Distribution
sample(
x,
size,
replace = FALSE,
prob = NULL)
R: Random Samples and Permutations
a <- runif(1000) hist(a); plot(a)
a <- rnorm(1000) hist(a); plot(a)
a <- sample(1:10, 1000, replace=T) hist(a); plot(a)
| 関数 | ヒストグラム | 散布図 |
|---|---|---|
| runif() | ![]() |
![]() |
| rnorm() | ![]() |
![]() |
| sample() | ![]() |
![]() |