Learn R Programming

easyPubMed (version 3.1.6)

EPM_custom_grep: 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")

Value

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

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".

Author

Damiano Fantini, damiano.fantini@gmail.com

References

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

Examples

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

Run the code above in your browser using DataLab