subsample: Sampling

Description Usage Arguments Details Value Author(s) Examples

View source: R/rda.R

Description

Subsample from a vector.

Usage

1
subsample(x, size, ...)

Arguments

x

(vector) A vector of values to be sampled.

size

(integer) The number of values to sample.

...

additional arguments taken by sample.

Details

This function is essentially the sample command but without the bug that sampling a vector x of length one returns a permutation of 1:x. This function was taken from an old help file for sample.

Value

A vector.

Author(s)

Peter Hoff

Examples

1
2
3
4
5
sample(1:4)
subsample(1:4)

sample(4)
subsample(4)

MikeKozelMSU/mcmcFunc documentation built on May 22, 2019, 5:31 p.m.