samp | R Documentation |
Present since hutils v1.4.0
.
Same as sample
, but avoiding the behaviour when
length(x) == 1L
.
samp(x, size = length(x), replace = size > length(x), loud = TRUE, prob = NULL)
x |
A vector. |
size |
A non-negative integer, the number of items to return. |
replace |
Should the sampling be done with replacement? Defaults to |
loud |
If |
prob |
As in |
samp(1:5) sample(1:5) samp(1:5, size = 10) # no error tryCatch(sample(1:5, size = 10), error = function(e) print(e$m)) samp(5, size = 3) sample(5, size = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.