powered by
Returns list elements within the index range [begin, end]. Uses 1-based indexing consistent with R conventions.
[begin, end]
am_list_range(doc, obj, begin, end, heads = NULL)
A list of values in the index range.
An Automerge document
An Automerge object ID (must be a list)
Start index (1-based, inclusive)
End index (1-based, inclusive)
Optional list of change hashes (raw vectors) for historical query. If NULL (default), uses the current state.
NULL
doc <- am_create() doc$items <- list("a", "b", "c", "d", "e") items <- doc$items # Get elements 2 through 4 -> "b", "c", "d" range <- am_list_range(doc, items, 2, 4) range am_close(doc)
Run the code above in your browser using DataLab