powered by
Draws a random (sub)sample from a multinomial distribution.
resample_multinomial(object, ...)# S4 method for numeric resample_multinomial(object, n, size = sum(object), ...)
# S4 method for numeric resample_multinomial(object, n, size = sum(object), ...)
A numeric
numeric
matrix with n rows and k columns.
matrix
n
k
A length-\(k\) integer vector, specifying the probability for the \(k\) classes; is internally normalized to sum to 1.
integer
Currently not used.
A non-negative integer specifying the number of random vector to draw.
A non-negative integer specifying the sample size.
N. Frerebeau
stats::rmultinom()
Other resampling methods: bootstrap(), jackknife(), resample_uniform()
bootstrap()
jackknife()
resample_uniform()
## Uniform distribution x <- rnorm(20) resample_uniform(x, n = 10) ## Multinomial distribution x <- sample(1:100, 20, TRUE) resample_multinomial(x, n = 10)
Run the code above in your browser using DataLab