Chapter 7 Abstracts
Fetching abstracts likely will come after searching for articles with
ft_search(). There are a few scenarios in which simply getting abstracts in lieu of full text may be enough.
For example, if you know that a large portion of the articles you want to mine text from are closed access and you don’t have access to them, you may have access to the abstracts depending on the publisher.
In addition, there are cases in which you really only need abstracts regardless of whether full text is available or not.
ft_abstract() gives you access to the following data sources:
List data sources available
#>  "crossref" "microsoft" "plos" "scopus" #>  "semanticscholar"
Search - by default searches against PLOS (Public Library of Science)
<- ft_search(query = "ecology") res <- res$plos$data$id)(dois
#>  "10.1371/journal.pone.0001248" "10.1371/journal.pone.0248090" #>  "10.1371/journal.pone.0059813" "10.1371/journal.pone.0080763" #>  "10.1371/journal.pone.0246749" "10.1371/journal.pone.0254411" #>  "10.1371/journal.pone.0220747" "10.1371/journal.pone.0155019" #>  "10.1371/journal.pone.0175014" "10.1371/journal.pone.0241618"
Take the output of
ft_search() and pass directly to
<- ft_abstract(dois) out out
#> <fulltext abstracts> #> Found: #> [Crossref: 4; Scopus: 0; Microsoft: 0; PLOS: 0; Semantic Scholar: 0]
The output has slots for each data source:
#>  "crossref" "plos" "scopus" "ma" #>  "semanticscholar"
Index to the data source you want to get data from, here selecting the first item:
#> $doi #>  "10.1371/journal.pone.0001248" #> #> $abstract #>  ""
Which gives a named list, with the DOI as the first element, then the abstract as a single character string.
You can then take these abstracts and use any number of R packages for text mining.
7.2 By Ids
Instead of using
ft_search() first, and passing those results to
ft_abstract(), you can pass article ids (character/numeric) to
Here, we’ll fetch abstracts for three articles from arXiv. With Semantic Scholar we need to prefix the string
arXiv to the ids (if you use DOIs you don’t need to prefix any string).
<- c("0710.3491", "0804.0713", "0810.4821", "1003.0315") arxiv_ids <- ft_abstract(x = paste0("arXiv:", arxiv_ids), from = "semanticscholar") out unname(vapply(out$semanticscholar, "[[", "", "abstract"))
7.3 Abstracts options
All data sources for
ft_abstract() accept configuration options as a named list. For example, if you set
from="plos" you can set additional PLOS specfiic options by passing a named list to
plosopts. You can find out what PLOS options are available by looking at the documention for
The only data source that doesn’t allow configuration options is Semantic Scholar.
As all functions in
fulltext, you can pass on curl options to each function call or set them globally for the session, see the curl options chapter.