searchPMC: Search PMC text and tables

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/searchPMC.R

Description

Search PMC text and tables for a specific pattern

Usage

1
searchPMC(x, pattern, caption = TRUE, before = FALSE, after = FALSE, ignore.case = TRUE, ...)

Arguments

x

output from pmcText or pmcTable or pmcSupp

pattern

character string containing a regular expression

caption

include caption in collapsed table rows

before

include sentence before match

after

include sentence after match

ignore.case

ignore case

...

other options passed to grep

Details

Searches text and collpased tables using grep and returns a data.frame with section title and sentence (or table name and row).

Value

A data.frame

Author(s)

Chris Stubben

See Also

pmcText

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
doc <- pmcOAI("PMC2231364" )
txt <- pmcText(doc)
searchPMC(txt, "virulen")
searchPMC(txt, "pathway")
searchPMC(txt, "accession")
# regular expression
searchPMC(txt, "[ACTGN]{6}")   # seqeunce
searchPMC(txt, "YPO[0-9]{4}")  # locus tag
searchPMC(txt, "[A-Z][a-z]{2}[A-Z]", ignore.case=FALSE)  # protein name

## End(Not run)

cstubben/pmcXML documentation built on May 14, 2019, 12:25 p.m.