Repeat matrix object respectively to its shape and orientation
crep(x, times) rrep(x, times)
x | matrix |
---|---|
times | number of repetitions |
matrix
crep = columnwise repetition
rrep = rowwise repetition
#> [,1] [,2] [,3] [,4] #> [1,] 1 1 1 1 #> [2,] 2 2 2 2 #> [3,] 3 3 3 3#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 #> [,15] [,16] [,17] [,18] [,19] [,20] #> [1,] 5 1 2 3 4 5#> [,1] #> [1,] 1 #> [2,] 2 #> [3,] 3 #> [4,] 1 #> [5,] 2 #> [6,] 3 #> [7,] 1 #> [8,] 2 #> [9,] 3 #> [10,] 1 #> [11,] 2 #> [12,] 3#> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 2 3 4 5 #> [2,] 1 2 3 4 5 #> [3,] 1 2 3 4 5 #> [4,] 1 2 3 4 5