Insert a new element in an Rd object
Insert a new element at a given position in an Rd object.
an Rd object
the content to insert.
position at which to insert
val, typically an integer but may be anything accepted by the operator "[[".
val is inserted at position
pos, between the elements at
pos is equal to 1,
val is prepended to
pos is missing or
equal to the length of
val is appended to
todo: allow vector
pos to insert deeper into the object.
pos to insert at a position specified by "tag" for example?
todo: more guarded copying of attributes?