Description Usage Arguments Details Value
This function will update an array with a sub-array, without any need for the user to worry about the dimension-names.
1 | update_array(.arr, .sub_arr, .env = parent.frame())
|
.arr |
The array we want to update. The code in its present incarnation requires an array with a full set of unique dimension-names, although I suppose it could be possible to extend to a case where the dimension-names are missing too. |
.sub_arr |
Tue sub-array we want to insert into |
.env |
An environment in which |
Arrays are awesome, but it can alas be agonising to keep track of the dimension-names. This function frees the user from such frustrations.
The result will depend on how .sub_arr
and
.arr
is related. If the dimension-names of .sub_arr
is contained in those of .arr
, but its dimension is in fact
smaller, then the result will be that .arr
will be filled
with copies of .sub_arr
along the unspecified dimensions. If
the dimensions are equal, then only those components in .arr
that directly match the dimension-names of .sub_arr
will be
affected.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.