View source: R/pwutilityfunctions.R
interleave_segments | R Documentation |
Interleave segments of a matrix based on specified indices
interleave_segments(matrix_data, ..., use_columns = TRUE)
matrix_data |
A matrix to interleave |
... |
Index vectors to extract segments (columns or rows) to interleave |
use_columns |
Logical, whether to operate on columns. If TRUE, the matrix is transposed before and after interleaving. |
Interleaved matrix
a <- matrix(1:8, ncol = 4)
interleave_segments(a, 1:2, 3:4, use_columns = TRUE)
interleave_segments(a, 1:2, 3:4, use_columns = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.