This function wraps generic_elsevier_api to give a retrieval of an object from the Elsevier Object Retrieval API

object_retrieval(id, identifier = c("scopus_id", "eid", "doi", "pii",
  "pubmed_id"), ref = NULL, http_end = NULL, ...)

process_object_retrieval(res)

download_object(url, api_key = NULL, api_key_error = TRUE,
  verbose = TRUE, headers = NULL, ...)

download_objects(url, ...)

Arguments

id

Identifier for object

identifier

Type of identifier to use

ref

document reference

http_end

any additional end to http statement. See generic_elsevier_api

...

Arguments to be passed to generic_elsevier_api or GET

res

result from object_retrieval

url

url to download from object_retrieval

api_key

Elsevier API key

api_key_error

Should there be an error if no API key?

verbose

Print messages from specification

headers

Headers passed to add_headers, passed to GET

Value

List of elements, similar to generic_elsevier_api

See also

Examples

api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = object_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) df = process_object_retrieval(x) df = df[ grepl("image/jpeg", df$mime_type),,drop = FALSE ] df = df[ df$type %in% "IMAGE-HIGH-RES",,drop = FALSE ] res = download_object(df$url[1]) if (interactive()) { browseURL(res$outfile) } else { img = res$content dims = dim(img)[1:2] mdim = max(dims) graphics::plot(c(0, ncol(img)), c(0, nrow(img)), type='n') graphics::rasterImage(img, 1, 1, ncol(img), nrow(img)) } }
#> HTTP specified is:https://api.elsevier.com/content/object/eid/1-s2.0-S1053811915002700-gr1_lrg.jpg?httpAccept=image%2Fjpeg