Learn R Programming

fulltext (version 1.4.0)

ft_abstract: Get abstracts

Description

Get abstracts

Usage

ft_abstract(
  x,
  from = "plos",
  plosopts = list(),
  scopusopts = list(),
  maopts = list(),
  crossrefopts = list(),
  ...
)

ft_abstract_ls()

Arguments

x

(character) DOIs as a character vector

from

Source to query. One or more of plos (default), scopus, microsoft, or crossref

plosopts

PLOS options, a named list.

scopusopts

Scopus options, a named list.

maopts

Microsoft Academic options, a named list.

crossrefopts

Crossref options, a named list.

...

curl options passed on to crul::HttpClient, see examples below

Value

An object of class ft_abstract

Details

See Rate Limits and Authentication in fulltext-package for rate limiting and authentication information, respectively

Examples

Run this code
# NOT RUN {
# List publishers included
ft_abstract_ls()

# }
# NOT RUN {
# PLOS
## search
(res <- ft_search(query = 'biology', from = 'plos', limit = 25,
   plosopts = list(fq = list('doc_type:full', '-article_type:correction',
                  '-article_type:viewpoints'))))
## get abstracts
dois <- res$plos$data$id
(out <- ft_abstract(x = dois, from = "plos"))
out$plos

# Scopus
opts <- list(key = Sys.getenv('ELSEVIER_SCOPUS_KEY'))

## search
(res <- ft_search(query = 'biology', from = 'scopus', scopusopts = opts,
  limit = 25))
## get abstract
dois <- na.omit(res$scopus$data$`prism:doi`)
out <- ft_abstract(x = dois[1:3], from = "scopus", scopusopts = opts)
out
out$scopus

(out <- ft_abstract(x = dois[1:5], from = "scopus", scopusopts = opts))

# use scopus Ids
(res <- ft_search(query = 'biology', from = 'scopus', scopusopts = opts,
  limit = 50))
ids <- fulltext:::strextract(res$scopus$data$`dc:identifier`, "[0-9]+")
(out <- ft_abstract(x = ids[1:4], from = 'scopus',
  scopusopts = list(
    key = Sys.getenv('ELSEVIER_SCOPUS_KEY'),
    id_type = "scopus_id"
  )
))

# Microsoft
key <- Sys.getenv("MICROSOFT_ACADEMIC_KEY")
(res <- ft_search("Y=[2010, 2012)", from = "microsoft",
  maopts = list(key = key)))
ids <- res$ma$data$Id
(out <- ft_abstract(x = ids, from = "microsoft",
  maopts = list(
    key = Sys.getenv('MICROSOFT_ACADEMIC_KEY')
  )
))
out$ma
cat(unlist(lapply(out$ma, "[[", "abstract")), sep = "\n\n")

# Crossref
(res <- ft_search("ecology", from = "crossref",
  crossrefopts = list(filter = c(has_abstract = TRUE))))
ids <- res$crossref$data$doi
(out <- ft_abstract(x = ids, from = "crossref"))
out$crossref

# curl options
ft_abstract("10.2458/v17i1.21696", from = "crossref", verbose = TRUE)
ft_abstract("10.1371/journal.pcbi.1002487", from = "plos", verbose = TRUE)
# }

Run the code above in your browser using DataLab