MyNixOS website logo
Description

R Bindings for 'Automerge' 'CRDT' Library.

Provides R bindings to the 'Automerge' Conflict-free Replicated Data Type ('CRDT') library. 'Automerge' enables automatic merging of concurrent changes without conflicts, making it ideal for distributed systems, collaborative applications, and offline-first architectures. The approach of local-first software was proposed in Kleppmann, M., Wiggins, A., van Hardenberg, P., McGranaghan, M. (2019) <doi:10.1145/3359591.3359737>. This package supports all 'Automerge' data types (maps, lists, text, counters) and provides both low-level and high-level synchronization protocols for seamless interoperability with 'JavaScript' and other 'Automerge' implementations.

automerge

Lifecycle:experimental CRANstatus R-CMD-check Codecov testcoverage

Conflict-free data synchronization for R

AskDeepWiki

automerge brings Automerge CRDTs (Conflict-free Replicated Data Types) to R, enabling automatic merging of concurrent changes across distributed systems without conflicts. Work offline, collaborate in real-time, or sync across platforms—changes merge automatically.

Why Automerge?

Traditional approaches to distributed data either require a central server to coordinate changes or force developers to write complex conflict resolution logic. Automerge’s CRDT technology automatically merges concurrent changes with mathematical guarantees, eliminating the need for coordination and making distributed systems dramatically simpler.

Quick Example

library(automerge)

# Two researchers working independently
alice <- am_create()
alice$experiment <- "trial_001"
alice$temperature <- 23.5
am_commit(alice, "Alice's data")

bob <- am_create()
bob$experiment <- "trial_002"
bob$humidity <- 65
am_commit(bob, "Bob's data")

# Later, sync with zero conflicts
am_sync(alice, bob)
alice
#> <Automerge Document>
#> Actor: 430ffacff3ae9ece2c50d476120588d1 
#> Root keys: 3 
#> Keys: experiment, humidity, temperature
bob
#> <Automerge Document>
#> Actor: abb94fd55ba7c10623aa19f30ae871b1 
#> Root keys: 3 
#> Keys: experiment, humidity, temperature

Key Features

  • Familiar R syntax: Work with CRDT documents like regular R lists
  • Rich data types: Maps, lists, text objects, counters, and timestamps
  • Collaborative text editing: Cursors and marks for rich text applications
  • Bidirectional sync: High-level am_sync() or low-level protocol access
  • Offline-first: Make changes offline, merge when connected
  • Cross-platform: Interoperates with JavaScript and other Automerge implementations
  • Zero dependencies: Only base R required at runtime

Installation

install.packages("automerge")

Building from source requires Rust >= 1.85 (rustup.rs) and CMake >= 3.25 (included in Rtools43+ on Windows).

Documentation

External Resources

Related Projects

  • autosync - automerge-repo compatible R sync server
  • autoedit - Collaborative code editor widget for R and Shiny

License

MIT License. See LICENSE for details. This package includes the automerge-c library (also MIT licensed)

Metadata

Version

0.4.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows