intersection_check {pubmedtk}R Documentation

Checks a column of PMID's for whether or not they would appear in a Pubmed search result.

Description

Checks a column of PMID's for whether or not they would appear in a Pubmed search result.

Usage

intersection_check(
  df,
  column,
  query,
  api_key,
  batch_size = 1000,
  quiet = FALSE
)

Arguments

df

A dataframe containing a column of PMID's

column

The name of the column containing PMID's

query

A character string containing a valid Pubmed search query

api_key

A valid Pubmed API key

batch_size

An integer greater than 0 and less than 10000

quiet

A boolean TRUE or FALSE. If TRUE, no progress messages will be printed during download. FALSE by default.

Value

A data frame containing the original columns, as well as two additional ones: pm_checked and found_in_pm_query.

The new `pm_checked` column is TRUE if Pubmed was successfully
queried and NA if Pubmed was not checked for that PMID (this
may occur in cases where the PMID to be checked is not
well-formed).

The new `found_in_pm_query` column is TRUE if the PMID in
question would appear in a search of Pubmed defined by the
query provided; FALSE if it would not appear in such a search
and NA if the PMID in question was not checked (this may occur
in cases where the PMID is not well-formed).

Examples


## Not run: 
## Read in API key
ak <- readLines("api_key.txt")

## Example publications and their corresponding PMID's (some valid
## and some not)
pubs <- tibble::tribble(
  ~pmid,
  "29559429",
  "28837722",
  "28961465",
  "32278621",
  "one hundred of them",
  "28837722",
  "28961465"
)

## Check which ones were authored by Carlisle:
intersection_check(pubs, "pmid", "Carlisle[Author]", ak)


## End(Not run)

[Package pubmedtk version 1.0.4 Index]