Learn R Programming

automerge (version 0.3.0)

am_commit_empty: Create an empty change

Description

Creates a new change in the document's history without any operations. This is useful for creating merge commits or recording metadata (message, timestamp) without making data changes.

Usage

am_commit_empty(doc, message = NULL, time = NULL)

Value

The document doc (invisibly)

Arguments

doc

An Automerge document

message

Optional commit message (character string)

time

Optional timestamp (POSIXct). If NULL, uses current time.

Examples

Run this code
doc <- am_create()
doc$key <- "value"
am_commit(doc, "Initial data")

# Create empty change as a checkpoint
am_commit_empty(doc, "Checkpoint")

am_close(doc)

Run the code above in your browser using DataLab