Skip to contents

Convert PubMed XLM files to dataframe

Usage

article_to_df2(
  pubmedArticle,
  autofill = FALSE,
  max_chars = 500,
  getKeywords = FALSE,
  getAuthors = TRUE
)

Arguments

pubmedArticle

The PubMed data, in XLM form.

autofill

Autofill the affiliation address when missing.

max_chars

Maximum number of characters for the address.

getKeywords

Whether to extract keywords as well.

getAuthors

Whether to extract the author information.

Examples

# \dontshow{
.old_wd <- setwd(tempdir())
# }
if (FALSE) {
dami_query <- paste(
  "passion [Title/Abstract]",
  "AND Dualistic Model of Passion [Text Word]",
  "AND ('2023/01/01' [Date - Publication] : '2023/12/31' [Date - Publication])"
)
dami_on_pubmed <- easyPubMed::get_pubmed_ids(dami_query)
dami_abstracts_xml <- easyPubMed::fetch_pubmed_data(dami_on_pubmed)
dami_abstracts_list <- easyPubMed::articles_to_list(dami_abstracts_xml)
article_to_df2(pubmedArticle = dami_abstracts_list[[2]], autofill = FALSE)[1, ]
}
# \dontshow{
unlink("easyPubMed_data_01.txt")
setwd(.old_wd)
# }