View source: R/sample_by_column.R
sample_by_column | R Documentation |
Shorthand to return a re-sample number of rows in a data frame by unique column
sample_by_column(.dt, col, n, seed = NULL, replace = FALSE)
.dt |
data frame to re-sample |
col |
column to uniquely re-sample |
n |
number of rows to return |
seed |
unique numeric value for reproducibility |
replace |
should sampling be with replacement |
data frame containing re-sampled rows from an original data frame
data1 <- data.frame(ID=1:10,MOT=11:20)
sample_by_column(data1,MOT,3)
sample_by_column(data1,ID,7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.