resample: Resample elements of vector.

Description Usage Arguments Value Examples

View source: R/resample.R

Description

A safer method than sample(x), for cases where length(x) may equal 1 or >1. See examples within ?sample.int.

Usage

1

Arguments

x

to-be resampled vector

...

(optional) additional arguments to sample.int

Value

a vector with elements resampled

Examples

1
2
resample(1:20, replace = TRUE)  ## bootstrap
resample(1:20, size = 4)  ## downsample

mcfreund/mfutils documentation built on Feb. 6, 2022, 4:57 a.m.