Description Usage Arguments Value See Also Examples
Analogous function for sample_n
and sample_frac
in dplyr.
1 2 3 | sample_n_dt(data, size, replace = FALSE)
sample_frac_dt(data, size, replace = FALSE)
|
data |
data.frame |
size |
|
replace |
Sample with or without replacement? Default uses |
data.table
1 2 3 4 | sample_n_dt(mtcars, 10)
sample_n_dt(mtcars, 50, replace = TRUE)
sample_frac_dt(mtcars, 0.1)
sample_frac_dt(mtcars, 1.5, replace = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.