doc <- am_create()
am_put(doc, AM_ROOT, "text", am_text("Hello World"))
text_obj <- am_get(doc, AM_ROOT, "text")
am_mark(text_obj, 0, 5, "bold", TRUE)
am_mark(text_obj, 6, 11, "italic", TRUE)
marks <- am_marks(text_obj)
marks
# List of 2 marks with name, value, start, end
am_close(doc)
Run the code above in your browser using DataLab