| rep_dim | R Documentation | 
The rep_dim() function
replicates array dimensions until the specified dimension sizes are reached,
and returns the array. 
The various broadcasting functions recycle array dimensions virtually,
meaning little to no additional memory is needed. 
The rep_dim() function,
however,
physically replicates the dimensions of an array
(and thus actually occupies additional memory space). 
rep_dim(x, tdim)
x | 
 an atomic or recursive array or matrix.  | 
tdim | 
 an integer vector, giving the target dimension to reach.  | 
Returns the replicated array.
x <- matrix(1:9, 3,3)
colnames(x) <- LETTERS[1:3]
rownames(x) <- letters[1:3]
names(x) <- month.abb[1:9]
print(x)
rep_dim(x, c(3,3,2)) # replicate to larger size
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.