resample_uniform: Draw Uniform Random Sample

resample_uniformR Documentation

Draw Uniform Random Sample

Description

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

Usage

resample_uniform(object, ...)

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

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?

Value

A numeric matrix with n rows and size columns.

Author(s)

N. Frerebeau

See Also

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

Examples

## Uniform distribution
x <- rnorm(20)
resample_uniform(x, n = 10)

## Multinomial distribution
x <- sample(1:100, 20, TRUE)
resample_multinomial(x, n = 10)

tesselle/arkhe documentation built on June 15, 2025, 12:05 a.m.