Description Usage Arguments Value
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.
1 | sample.fixed(x, size)
|
x |
Vector to be sampled |
size |
Number of samples to take. Must be an integer less than x but greater than zero. |
A vector of length size sampled from x. If the length of x is 1, this returns x.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.