View source: R/reconstruct_abstract.R
reconstruct_abstract | R Documentation |
Convert from a inverted index of abstract words into a full string corresponding to the original abstract. Inverted index is the way in which an abstract is broken up and provided by the Open Alex API as a list of words and locations.
reconstruct_abstract(inverted_index)
inverted-index |
A named character vector containing the locations as integers of words. The character vector can contain any number of other fields: i.e. it can be the full set of results returned by the Open Alex API. Each character in the vector should be named using the Open Alex abstract inverted index term naming convention as follows: 'abstract_inverted_index_word', where word is the word in question. Multiple occurrences of the same word are represented by multiple named characters, but with a numerical suffix (i.e. 'abstract_inverted_index_the1' and 'abstract_inverted_index_the2'). |
A single character string corresponding to the original abstract.
## Not run:
devtools::install_github("kth-library/openalex", dependencies = TRUE)
library(openalex)
openalex_polite("neal_haddaway@hotmail.com")
input <- data.frame(ids = c('10.1371/journal.pone.0138237', '10.1186/s13750-016-0059-6', 'The role of tourism and recreation in the spread of non-native species: a systematic review and meta-analysis'),
type = c('doi', 'doi', 'title'))
results <- search_openAlex(input)
record <- results[['10.1371/journal.pone.0138237']]
reconstruct_abstract(record)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.