list.sample | R Documentation |
Sample a list or vector
list.sample(.data, size, replace = FALSE, weight = 1, prob = NULL)
.data |
A |
size |
|
replace |
|
weight |
A lambda expression to determine the weight of
each list member, which only takes effect if |
prob |
A |
x <- list(a = 1, b = c(1,2,3), c = c(2,3,4)) list.sample(x, 2, weight = sum(.))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.