Learn R Programming

automerge (version 0.4.0)

as.character.am_text: Convert text object to character string

Description

Extracts the full text content from an Automerge text object as a standard character string.

Usage

# S3 method for am_text
as.character(x, ...)

Value

Character string with the full text content

Arguments

x

An Automerge text object

...

Additional arguments (unused)

Examples

Run this code
doc <- am_create()

am_put(doc, AM_ROOT, "notes", am_text("Hello World"))
text_obj <- am_get(doc, AM_ROOT, "notes")
text_obj

text_string <- as.character(text_obj)
text_string  # "Hello World"

identical(as.character(text_obj), am_text_content(text_obj))  # TRUE

am_close(doc)

Run the code above in your browser using DataLab