sample_n_by | R Documentation |
sample n rows by group from a table using the sample_n()
function.
sample_n_by(data, ..., size = 1, replace = FALSE)
data |
a data frame |
... |
Variables to group by |
size |
the number of rows to select |
replace |
with or without replacement? |
ToothGrowth %>% sample_n_by(dose, supp, size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.