sample.fixed: Sample (fixed)

Description Usage Arguments Value

Description

Goal is to correct the default behavior of the "sample" function in R. The default behavior changes if only one sample is needed, but some of my code depends on consistent behavior. Consequently, this function avoids the change in behavior.

Usage

1
sample.fixed(x, size)

Arguments

x

Vector to be sampled

size

Number of samples to take. Must be an integer less than x but greater than zero.

Value

A vector of length size sampled from x. If the length of x is 1, this returns x.


akeyel/spatialdemography documentation built on May 12, 2019, 4:43 a.m.