doc <- am_create()
am_put(doc, AM_ROOT, "text", am_text("Hello World"))
text_obj <- am_get(doc, AM_ROOT, "text")
# Add a mark
am_mark(text_obj, 0, 11, "bold", TRUE)
length(am_marks(text_obj)) # 1
# Clear the mark
am_mark_clear(text_obj, 0, 11, "bold")
length(am_marks(text_obj)) # 0
am_close(doc)
Run the code above in your browser using DataLab