doc <- am_create()
doc$key <- "value"
am_commit(doc)
# Save full document
full <- am_save(doc)
# Make more changes
doc$key2 <- "value2"
am_commit(doc)
# Save only the new changes
incremental <- am_save_incremental(doc)
length(incremental) < length(full) # TRUE (smaller)
am_close(doc)
Run the code above in your browser using DataLab