Description Usage Arguments Value Examples
dplyr like sample_frac for a matrix
1 | sample_frac_matrix(mat, frac, replace = FALSE, weight = NULL)
|
mat |
A matrix |
frac |
fraction of rows to sample |
replace |
See arguments for 'base::sample' |
weight |
See arguments for 'base::sample' |
A matrix
1 2 3 | library("magrittr")
mat <- matrix(1:1e4, ncol = 10)
mat %>% sample_frac_matrix(0.1) %>% dim()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.