powered by
Draws a random (sub)sample (with or without replacement).
resample_uniform(object, ...)# S4 method for numeric resample_uniform(object, n, size = length(object), replace = FALSE, ...)
# S4 method for numeric resample_uniform(object, n, size = length(object), replace = FALSE, ...)
A numeric
numeric
matrix with n rows and size columns.
matrix
n
size
A numeric vector.
Currently not used.
A non-negative integer specifying the number of random vector to draw.
integer
A non-negative integer specifying the sample size.
A logical scalar: should sampling be with replacement?
logical
N. Frerebeau
Other resampling methods: bootstrap(), jackknife(), resample_multinomial()
bootstrap()
jackknife()
resample_multinomial()
## 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