as_a | R Documentation |
Converts a tensor()
to an array()
by stripping the index labels.
An index label order
needs to be provided so that the array's dim()
order is well defined.
as_a(x, ...)
x |
A labeled array ("tensor" object) created by |
... |
Index labels separated by commas optionally prefixed by "+" and "-"
to indicate the index position (upper and lower respectively).
If no prefix is provided, a lower index ("-") is assumed.
This argument uses non-standard evaluation: any R symbol
that is not a reserved keyword can be used.
The specification needs to match all the labels occurring in |
A usual array()
without attached labels. The dimension order is
determined by ...
.
The same functionality is implemented in as.array.tensor()
but with standard evaluation.
array(1:8, dim = c(2, 2, 2)) %_% .(i, +i, k) |> as_a(k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.