powered by
Add elements to a container by reference. Overwrites existing container values tied to the same keys.
insert_or_assign(x, values, keys)
Invisibly returns NULL.
NULL
A CppMap or CppUnorderedMap object.
Values to add to x.
x
Keys to add to x.
Use insert to avoid overwriting values.
insert, insert_after, emplace, try_emplace.
emplace
try_emplace
m <- cpp_map(4:6, 9:11) m # [4,9] [5,10] [6,11] insert_or_assign(m, 12:13, 6:7) m # [4,9] [5,10] [6,12] [7,13]
Run the code above in your browser using DataLab