histx | R Documentation |
Given the breaks and the number of observations, a data set is generated with stats::runif()
, using
the class mids: x_i = class\_mid_j + alpha*class\_width_j/2
. The default alpha=0.99
ensures that
generated observations do not lie on the class borders.
histx(breaks, n, alpha = 0.99)
gen_mid(breaks, n, alpha = 0.99)
dhistx(breaks, n, alpha = 0.99)
breaks |
numeric: class borders |
n |
numeric: number of observations in each class |
alpha |
numeric: how far the generated observations can be away from the class mids (default: |
The generated data set.
breaks <- sort(sample(seq(0.1, 0.9, by=0.1), 4))
bins <- length(breaks)-1
n <- rmultinom(1, size=100, prob=ddiscrete(runif(bins)))
histx(breaks, n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.