Sample rows from a dataframe or matrix
Sample rows from a dataframe or matrix
randomRows(x, size, replace = FALSE, prob = NULL)
x |
a data frame or matrix |
size |
a non-negative integer giving the number of items to choose. |
replace |
Should sampling be with replacement? |
prob |
A vector of probability weights for obtaining the elements of the vector being sampled. |
Matched parameters to sample – njf, May 18, 2015
sample_n
for dplyr users
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.