Description Usage Arguments Value Examples
View source: R/multivariance-functions.R
resample the columns of a matrix
1 | sample.cols(x, vec = 1:ncol(x), replace = TRUE, incl.first = TRUE)
|
x |
matrix |
vec |
vector, indicates which columns belong together |
replace |
boolean, sampling with or without replacement |
incl.first |
boolean, if |
Returns a matrix with the same dimensions as x
. The columns are resampled from the original columns. The resampling is done with replacement (replace = TRUE
) or without (replace = FALSE
). Columns which belong together (indicated by vec) are resampled identically, i.e., all values in rows of these are kept together.
1 | sample.cols(matrix(1:15,nrow = 5),vec = c(1,1,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.