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