core_articles_search: Search CORE articles

View source: R/core_articles_search.R

core_articles_searchR Documentation

Search CORE articles

Description

Search CORE articles

Usage

core_articles_search(
  query,
  metadata = TRUE,
  fulltext = FALSE,
  citations = FALSE,
  similar = FALSE,
  duplicate = FALSE,
  urls = FALSE,
  faithfulMetadata = FALSE,
  page = 1,
  limit = 10,
  key = NULL,
  parse = TRUE,
  ...
)

core_articles_search_(
  query,
  metadata = TRUE,
  fulltext = FALSE,
  citations = FALSE,
  similar = FALSE,
  duplicate = FALSE,
  urls = FALSE,
  faithfulMetadata = FALSE,
  page = 1,
  limit = 10,
  key = NULL,
  ...
)

Arguments

query

(character) query string, required

metadata

(logical) Whether to retrieve the full article metadata or only the ID. Default: TRUE

fulltext

(logical) Whether to retrieve full text of the article. Default: FALSE

citations

(logical) Whether to retrieve citations found in the article. Default: FALSE

similar

(logical) Whether to retrieve a list of similar articles. Default: FALSE. Because the similar articles are calculated on demand, setting this parameter to true might slightly slow down the response time

duplicate

(logical) Whether to retrieve a list of CORE IDs of different versions of the article. Default: FALSE

urls

(logical) Whether to retrieve a list of URLs from which the article can be downloaded. This can include links to PDFs as well as HTML pages. Default: FALSE

faithfulMetadata

(logical) Returns the records raw XML metadata from the original repository. Default: FALSE

page

(character) page number (default: 1), optional

limit

(character) records to return (default: 10, minimum: 10, maximum: 100), optional

key

A CORE API key. Get one at https://core.ac.uk/api-keys/register. Once you have the key, you can pass it into this parameter, or as a much better option, store your key as an environment variable with the name CORE_KEY or an R option as core_key. See ?Startup for how to work with env vars and R options

parse

(logical) Whether to parse to list (FALSE) or data.frame (TRUE). Default: TRUE

...

Curl options passed to HttpClient

Details

core_articles_search does the HTTP request and parses, while core_articles_search_ just does the HTTP request, gives back JSON as a character string

References

https://core.ac.uk/docs/#!/all/search

Examples

## Not run: 
core_articles_search(query = 'ecology')
core_articles_search(query = 'ecology', parse = FALSE)
core_articles_search(query = 'ecology', limit = 12)
out = core_articles_search(query = 'ecology', fulltext = TRUE)

core_articles_search_(query = 'ecology')
jsonlite::fromJSON(core_articles_search_(query = 'ecology'))

# post request
query <- c('data mining', 'semantic web')
res <- core_articles_search(query)
head(res$data)
res$data[[2]]$doi

## End(Not run)

ropensci/rcore documentation built on Sept. 16, 2022, 5:36 p.m.