sample_n_matrix.Rddplyr like sample_n for a matrix
sample_n_matrix(mat, n, replace = FALSE, weight = NULL)
| mat | A matrix |
|---|---|
| n | Number of rows to sample |
| replace | See arguments for 'base::sample' |
| weight | See arguments for 'base::sample' |
A matrix library("magrittr") mat <- matrix(1:1e4, ncol = 10) mat