| am_create | R Documentation |
Creates a new Automerge document with an optional custom actor ID. If no actor ID is provided, a random one is generated.
am_create(actor_id = NULL)
actor_id |
Optional actor ID. Can be:
|
An external pointer to the Automerge document with class
c("am_doc", "automerge").
The automerge package is NOT thread-safe. Do not access the same document
from multiple R threads concurrently. Each thread should create its own
document with am_create() and synchronize changes via
am_sync_*() functions after thread completion.
# Create document with random actor ID
doc1 <- am_create()
# Create with custom hex actor ID
doc2 <- am_create("0123456789abcdef0123456789abcdef")
# Create with raw bytes actor ID
actor_bytes <- as.raw(1:16)
doc3 <- am_create(actor_bytes)
am_close(doc1)
am_close(doc2)
am_close(doc3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.