arep | R Documentation |
arep_times()
and arep_each()
are multidimensional
versions of base::rep( , times=)
and base::rep( , each=)
,
respectively.
They're both generic functions with default methods that work on any
array-like object that supports [
(single-bracket subsetting).
arep_times(x, times)
arep_each(x, each)
x |
An array-like object, that is, an ordinary array or any object with dimensions. |
times , each |
An integer vector parallel to |
An array-like object of the same class as x
and with dimensions
dim(x) * times
for arep_times
or dim(x) * each
for arep_each
.
The dimnames on x
are propagated, if any.
base::rep
in the base package.
array and matrix objects in base R.
m <- matrix(1:10, nrow=2)
arep_times(m, c(4, 2))
arep_each(m, c(4, 2))
## Note that the output array is 'prod(times)' (or 'prod(each)') times
## bigger than the input array!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.