json_merge | R Documentation |
By merging two objects you can add, modify, or remove elements of an object.
Arrays cannot be modified but only replaced as a whole. It is mostly a small
wrapper around the SQLite function
json_patch()
.
json_merge(x, y)
x |
A JSON vector to update. |
y |
A JSON vector with updated values. |
A json2
vector.
# update element with key "a"
json_merge('{"a": 1, "c": 3}', '{"a": 11}')
# you can also add elements
json_merge('{"a": 1, "c": 3}', '{"b": 2}')
# remove elements with `null`
json_merge('{"a": 1, "c": 3}', '{"c": null}')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.