21 lines
392 B
R
21 lines
392 B
R
elements = runif(1000)
|
|
|
|
effectifs = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
keys = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
|
|
for (i in 0:9) {
|
|
borne_min = i/ 10
|
|
borne_max = (i + 1) / 10
|
|
|
|
for (e in elements) {
|
|
if (e >= borne_min && e <= borne_max) {
|
|
effectifs[i + 1] = effectifs[i + 1] + 1
|
|
}
|
|
}
|
|
|
|
keys[i + 1] = i + 0.5
|
|
}
|
|
|
|
df = data.frame(keys, effectifs)
|
|
|
|
print(df) |