Skip to contents

Replicates a matrix based on a replication matrix.

Usage

replicateMatrix(matrix, replication_matrix)

Arguments

matrix

Matrix to replicate

replication_matrix

Replication matrix

Value

Replicated matrix

Examples

matrix <- matrix(1:9, nrow = 3, ncol = 3)
replication_matrix <- matrix(TRUE, nrow = 3, ncol = 3)
replicateMatrix(matrix, replication_matrix)
#>      _1 _2 _3 _1 _2 _3 _1 _2 _3
#> [1,]  1  1  1  4  4  4  7  7  7
#> [2,]  2  2  2  5  5  5  8  8  8
#> [3,]  3  3  3  6  6  6  9  9  9