Learn R Programming

arkhe (version 1.11.0)

resample_uniform: Draw Uniform Random Sample

Description

Draws a random (sub)sample (with or without replacement).

Usage

resample_uniform(object, ...)

# S4 method for numeric resample_uniform(object, n, size = length(object), replace = FALSE, ...)

Value

A numeric

matrix with n rows and size columns.

Arguments

object

A numeric vector.

...

Currently not used.

n

A non-negative integer specifying the number of random vector to draw.

size

A non-negative integer specifying the sample size.

replace

A logical scalar: should sampling be with replacement?

Author

N. Frerebeau

See Also

Other resampling methods: bootstrap(), jackknife(), resample_multinomial()

Examples

Run this code
## 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