Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Append to the specified element or after the last element at a specified level of an expression
ResourceFunction["AppendAt"][expr,elem,level] gives expr with elem appended to the end of the last expression at depth level. | |
ResourceFunction["AppendAt"][expr,elem,{k1,k2,…}] appends elem to the part of expr at the position specified by indices ki. | |
ResourceFunction["AppendAt"][assoc,elem,{key}] appends elem to the value corresponding to the specified key in the association. |
Append to the last part of the expression at the specified level:
In[1]:= |
|
Out[1]= |
|
Append to the element of the expression at the specified position:
In[2]:= |
|
Out[2]= |
|
Append to the values at the specified string key in the association:
In[3]:= |
|
Out[3]= |
|
Specify an arbitrary key:
In[4]:= |
|
Out[4]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License