txt_sample | R Documentation |
Boilerplate function to sample one element from a vector.
txt_sample(x, na.exclude = TRUE, n = 1)
x |
a vector |
na.exclude |
logical indicating to remove NA values before taking a sample |
n |
integer indicating the number of items to sample from |
one element sampled from the vector x
sample.int
txt_sample(c(NA, "hello", "world", NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.