get_articles_by_terms: Returns a list of articles matching the termlist items in the...

Description Usage Arguments Value Examples

View source: R/rpubmed_textsearch.R

Description

Returns a list of articles matching the termlist items in the termlist can be strings or character vectors, concatenated to an "or" regex e.g list(c("gprd", "diabetes")) returns all articles mentioning either gprd or diabetes. different items in the list recursively filter the list e.g. list("gprd", "diabetes") returns articles mentioning gprd and diabtes

Usage

1
2
  get_articles_by_terms(corpus, term_list, where,
    case_sensitive = FALSE, ...)

Arguments

corpus

list of downloaded Pubmed records, e.g. from rpubmed_fetch_in_chunks

term_list

list of character vectors giving the search terms. list elements are searched for reductively (using &). Elements of internal charater vectors are combined into 'or' terms

where

A predicate function referring to a search in an area of the record. Choose from in_abstract_p, in_mesh_p or in_mesh_abstract_p

case_sensitive

boolean is the search case sensitive?

dots

arguments to be passed down to grep, e.g. invert = TRUE, perl = TRUE

Value

list containing abstracts and metadata for each ID matching the search criteria

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
plasticity_records <- fetch_in_chunks(plasticity_ids)

# Search for articles with "plant" and "fish" in the abstract
get_articles_by_terms(plasticity_records, list("plant", "fish"), where = in_abstract_p)

# Search for records with "plant" or "fish" in the abstract or MeSH headings:
get_articles_by_terms(plasticity_records, list(c("plant", "fish")), where = in_mesh_abstract_p)

## End(Not run)

rpubmed documentation built on May 2, 2019, 5:25 p.m.