View source: R/Record_search.R
search_pubmed | R Documentation |
Perform an API search using Pubmed E-utilities https://www.ncbi.nlm.nih.gov/books/NBK25501/.
search_pubmed( query, year_query = NULL, additional_fields = NULL, api_key = getOption("baysren.ncbi_api_key"), record_limit = numeric() )
query |
A boolean query with AND/OR/NOT operators, brackets for term grouping and quotation marks for n-grams. |
year_query |
A year based filtering query. See |
additional_fields |
Additional fields to add to the query. Will not be normalized, so it must already follow Pubmed specific syntax. |
api_key |
Not mandatory but is helpful when performing searches with a large number of results to avoid quota limitations. |
record_limit |
A limit on the number of records collected. |
An API key is not mandatory but may avoid quota limitation for searches that return a large number of results. Large results sets are obtained by iterative querying.
Requires the rentrez
package.
A data frame of records.
## Not run: # Initial query to be built on domain knowledge. It accepts OR, AND, NOT # boolean operators and round brackets to group terms. query <- '((model OR models OR modeling OR network OR networks) AND (dissemination OR transmission OR spread OR diffusion) AND (nosocomial OR hospital OR "long-term-care" OR "long term care" OR "longterm care" OR "long-term care" OR "healthcare associated") AND (infection OR resistance OR resistant))' # Year filter. The framework converts it to the API-specific format seamlessly. # common logical comparators can be used, i.e. <, <=, >, >=, while dashes # denotes inclusive date intervals. A single year restricts results to one year # period. year_filter <- "2010-2020" records <- search_pubmed(query, year_filter) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.