Description Usage Arguments Details Value See Also Examples
rray_dim()
finds the dimension of a single object.
rray_dim_common()
finds the common dimensions of a set of objects.
1 2 3 |
x |
An object. |
... |
Objects to find common dimensions for. |
rray_dim_common()
first finds the common dimensionality,
makes any implicit dimensions explicit, then recycles the size of each
dimension to a common size.
As an example, the common dimensions of (4, 5)
and (4, 1, 2)
are:
1 2 3 4 |
The resulting dimensions from rray_dim_common()
are the dimensions that
are used in broadcasted operations.
An integer vector containing the common dimensions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | x_1_by_4 <- rray(c(1, 2, 3, 4), c(1, 4))
x_5_by_1 <- rray(1:5, c(5, 1))
rray_dim(x_1_by_4)
# recycle rows: 1 VS 5 = 5
# recycle cols: 4 VS 1 = 4
rray_dim_common(x_1_by_4, x_5_by_1)
x_5_by_1_by_3 <- rray(1, c(5, 1, 3))
# recycle rows: 5 VS 1 = 5
# recycle cols: 4 VS 1 = 4
# recycle 3rd dim: 1 VS 3 = 3
# (here, 3rd dim of 1 for the matrix is implicit)
rray_dim_common(x_1_by_4, x_5_by_1_by_3)
# The dimensions of NULL are 0
rray_dim(NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.