EPM_custom_grep: Custom XML Tag Matching.

EPM_custom_grepR Documentation

Custom XML Tag Matching.

Description

Extract text form a string containing XML or HTML tags. Text included between tags of interest will be returned. If multiple tagged substrings are found, they will be returned as different elements of a list or character vector.

Usage

EPM_custom_grep(xml_data, tag, xclass = NULL, format = "list")

Arguments

xml_data

String (character vector of length 1), this is a string including PubMed records or string including XML/HTML tags.

tag

String (character vector of length 1), the tag of interest (e.g., "Title") (should NOT include < > chars).

xclass

String (character vector of length 1), a tag decorator of interest (e.g., "EIdType=\"doi\""). Can be NULL.

format

String. Must be a value in c("list", "char"). Indicates the type of output. Defaults to "list".

Value

List or vector where each element corresponds to an in-tag substring.

Author(s)

Damiano Fantini, damiano.fantini@gmail.com

References

https://www.data-pulse.com/dev_site/easypubmed/

Examples

x <- "This string includes <Ti>an XML Tag</Ti>."
easyPubMed:::EPM_custom_grep(x, tag = "Ti")


dami82/easyPubMed documentation built on Jan. 4, 2024, 6:21 a.m.