drop_tags | R Documentation |
This function takes a character vector and returns a copy from which all
XML-like tags have been removed. Moreover, if half_tags_too = TRUE
any half tag at the beginning or end of x
is also removed.
drop_tags(x, half_tags_too = TRUE)
x |
String with XML tag |
half_tags_too |
Logical. Whether tags with only opening/closing bracket should also be removed. |
This function is not XML-aware. It uses a very simple definition of what
counts as a tag. More specifically, any character sequence starting with
<
and ending with >
is considered a 'tag'; inside such a tag, between
<
and >
, drop_tags()
accepts any sequence of zero or more characters.
Character string
xml_snippet <- "id='3'/><w pos='Det'>An</w> <w pos='N'>example</w> <w" drop_tags(xml_snippet) drop_tags(xml_snippet, half_tags_too = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.