Learn R Programming

automerge (version 0.3.0)

am_equal: Test document equality

Description

Tests whether two Automerge documents have the same content. Documents are equal if they have the same set of changes applied, regardless of how they were created.

Usage

am_equal(doc1, doc2)

Value

A logical scalar: TRUE if the documents are equal, FALSE

otherwise.

Arguments

doc1

An Automerge document

doc2

An Automerge document

Examples

Run this code
doc1 <- am_create()
doc1$key <- "value"
am_commit(doc1)

doc2 <- am_clone(doc1)
am_equal(doc1, doc2)  # TRUE

doc2$key <- "different"
am_equal(doc1, doc2)  # FALSE

am_close(doc1)
am_close(doc2)

Run the code above in your browser using DataLab