# Create two documents with different changes
doc1 <- am_create()
doc2 <- am_create()
# Make changes in each document
am_put(doc1, AM_ROOT, "x", 1)
am_put(doc2, AM_ROOT, "y", 2)
# Synchronize them (documents modified in place)
rounds <- am_sync(doc1, doc2)
cat("Synced in", rounds, "rounds\n")
# Now both documents have both x and y
Run the code above in your browser using DataLab