Learn R Programming

easyPubMed (version 3.1.6)

table_articles_byAuth: Extract Publication and Affiliation Data from PubMed Records

Description

Extract Publication Info from PubMed records and cast data into a data.frame where each row corresponds to a different author. It is possible to limit data extraction to first authors or last authors only, or get information about all authors of each PubMed record.

Usage

table_articles_byAuth(
  pubmed_data,
  included_authors = "all",
  max_chars = 500,
  autofill = TRUE,
  dest_file = NULL,
  getKeywords = TRUE,
  encoding = "UTF8"
)

Value

Data frame including the following fields: `c("pmid", "doi", "title", "abstract", "year", "month", "day", "jabbrv", "journal", "keywords", "mesh", "lastname", "firstname", "address", "email")`.

Arguments

pubmed_data

PubMed Data in XML format: typically, an XML file resulting from a batch_pubmed_download() call or an XML object, result of a fetch_pubmed_data() call.

included_authors

Character: c("first", "last", "all"). Only includes information from the first, the last or all authors of a PubMed record.

max_chars

This argument is ignored. In this version of the function, the whole Abstract Text is returned.

autofill

Logical. If TRUE, missing affiliations are imputed according to the available values (from the same article).

dest_file

String (character of length 1). Name of the file that will be written for storing the output. If NULL, no file will be saved.

getKeywords

This argument is ignored. In this version of the function MeSH terms and codes (i.e., keywords) are parsed by default.

encoding

The encoding of an input/output connection can be specified by name (for example, "ASCII", or "UTF-8", in the same way as it would be given to the function base::iconv(). See iconv() help page for how to find out more about encodings that can be used on your platform. Here, we recommend using "UTF-8".

Author

Damiano Fantini damiano.fantini@gmail.com

Details

The `table_articles_byAuth()` function is now obsolete. You should use the `epm_parse()` function instead. Please, have a look at the manual or the vignette. The `table_articles_byAuth()` function will be retired in 2026.

References

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

Examples

Run this code
# Note: a time limit can be set in order to kill the operation when/if 
# the NCBI/Entrez server becomes unresponsive.
setTimeLimit(elapsed = 4.9)
try({
  q0 <- 'Damiano Fantini[AU] AND "2018"[PDAT]'
  q1 <- easyPubMed::get_pubmed_ids(pubmed_query_string = q0)
  q2 <- fetch_pubmed_data(pubmed_id_list = q1)
  df <- table_articles_byAuth(q2, included_authors = 'first')
  df[, c('pmid', 'lastname', 'jabbrv', 'year', 'month', 'day')]
}, silent = TRUE)
setTimeLimit(elapsed = Inf)


Run the code above in your browser using DataLab