Learn R Programming

automerge (version 0.4.0)

am_change_size: Get the number of operations in a change

Description

Returns the number of operations contained in the change. Useful for estimating the size of changes before syncing or storing them.

Usage

am_change_size(change)

Value

An integer (or double for very large values exceeding R's 32-bit integer range)

Arguments

change

An am_change object (from am_get_changes() or am_change_from_bytes())

Examples

Run this code
doc <- am_create()
am_put(doc, AM_ROOT, "x", 1)
am_put(doc, AM_ROOT, "y", 2)
am_commit(doc, "Add keys")

history <- am_get_changes(doc)
am_change_size(history[[1]])  # 2

am_close(doc)

Run the code above in your browser using DataLab