Description Usage Arguments Value Examples
View source: R/saviUtilityFunctions.R
The default sample function is not compatible with vectors of length 1. If the code says "sample(3:3)," sample will return a random integer between 1 and 3. The way our code is written, we would like it to return just 3. We implement the following function for that purpose.
1 | sampleOne(x)
|
x |
A vector of integers |
A random integer from x. If x is c(5:5), return 5.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.