Title: | Scopus Database 'API' Interface |
---|---|
Description: | Uses Elsevier 'Scopus' API <https://dev.elsevier.com/sc_apis.html> to download information about authors and their citations. |
Authors: | John Muschelli [aut, cre] |
Maintainer: | John Muschelli <[email protected]> |
License: | GPL-2 |
Version: | 0.7.2 |
Built: | 2024-10-25 04:01:54 UTC |
Source: | https://github.com/muschellij2/rscopus |
This function wraps generic_elsevier_api
to give a
retrieval of an abstract from the Elsevier Abstract Retrieval API
abstract_retrieval( id, identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id", "pui", "group_id"), http_end = NULL, ... )
abstract_retrieval( id, identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id", "pui", "group_id"), http_end = NULL, ... )
id |
Identifier for abstract |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = abstract_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) x = abstract_retrieval("S1053811915002700", identifier = "pii", view = "FULL", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = abstract_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) x = abstract_retrieval("S1053811915002700", identifier = "pii", view = "FULL", verbose = FALSE) }
Searches SCOPUS to get information about documents on an affiliation
affil_df( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE, facets = NULL, sort = "document-count", ... ) affil_data( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE, facets = NULL, sort = "document-count", ... )
affil_df( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE, facets = NULL, sort = "document-count", ... ) affil_data( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE, facets = NULL, sort = "document-count", ... )
affil_id |
Affiliation ID number. |
affil_name |
affiliation name. Disregarded if |
api_key |
Elsevier API key |
verbose |
Print diagnostic messages |
facets |
Facets sent in query. See https://dev.elsevier.com/api_docs.html |
sort |
sorting sent to query |
... |
Arguments to be passed to |
List of entries from SCOPUS
The affil_data
command will return the list of all entries as well as
the data.frame
Take a SCOPUS entry and transform it to a data frame of affiliations
affil_list_to_df(affils)
affil_list_to_df(affils)
affils |
List of affiliations, from |
A data.frame
of affiliation information. A column named
"index"
denotes the element of the object affils
that the row
corresponds to
Searches SCOPUS to get information about documents on an author.
affil_search( affil_id, searcher = "AF-ID", http = "https://api.elsevier.com/content/search/affiliation", facets = "affilcountry(sort=document-count)", count = 200, ... )
affil_search( affil_id, searcher = "AF-ID", http = "https://api.elsevier.com/content/search/affiliation", facets = "affilcountry(sort=document-count)", count = 200, ... )
affil_id |
Affiliation ID number |
searcher |
Identifier for Affiliation ID. Do not change unless you know exactly what the API calls for. |
http |
Address for scopus api |
facets |
Facets sent in query. See https://dev.elsevier.com/api_docs.html |
count |
number of records to retrieve (below 200, see https://dev.elsevier.com/api_key_settings.html) |
... |
Arguments to be passed to |
List of entries from SCOPUS
This function wraps generic_elsevier_api
to give a
retrieval of an affiliation from the Elsevier Affiliation Retrieval API
affiliation_retrieval( id, identifier = c("affiliation_id", "eid"), http_end = NULL, ... )
affiliation_retrieval( id, identifier = c("affiliation_id", "eid"), http_end = NULL, ... )
id |
Identifier for affiliation |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = affiliation_retrieval("60006183", identifier = "affiliation_id", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = affiliation_retrieval("60006183", identifier = "affiliation_id", verbose = FALSE) }
Take a SCOPUS entry and transform it to a data frame of all affiliations listed in there
all_possible_affils(entries)
all_possible_affils(entries)
entries |
list of entries from SCOPUS,
usually from |
A data.frame
of affiliations
This function wraps generic_elsevier_api
to give a
retrieval of an article from the Elsevier Article Retrieval API
article_retrieval( id, view = c("META", "META_ABS", "META_ABS_REF", "FULL", "REF", "ENTITLED"), identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id"), http_end = NULL, ... )
article_retrieval( id, view = c("META", "META_ABS", "META_ABS_REF", "FULL", "REF", "ENTITLED"), identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id"), http_end = NULL, ... )
id |
Identifier for article |
view |
Which view to see. See https://dev.elsevier.com/guides/ArticleRetrievalViews.htm |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = article_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE, view = "FULL") gen = x$content$`full-text-retrieval-response` ot = gen$originalText } else { x = article_retrieval("S1053811915002700", identifier = "pii", api_key_error = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = article_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE, view = "FULL") gen = x$content$`full-text-retrieval-response` ot = gen$originalText } else { x = article_retrieval("S1053811915002700", identifier = "pii", api_key_error = FALSE) }
Searches SCOPUS to get information about documents
on an author.
Note, author_list
returns a list of the entries from
author_search
,
but allows you to put in a name.
author_df( au_id = NULL, last_name = NULL, first_name = NULL, api_key = NULL, verbose = TRUE, all_author_info = FALSE, http = "https://api.elsevier.com/content/search/scopus", view = "COMPLETE", count = 25, general = TRUE, scrub = FALSE, headers = NULL, ... ) author_df_orig(..., general = FALSE) author_list( au_id = NULL, last_name = NULL, first_name = NULL, api_key = NULL, verbose = TRUE, http = "https://api.elsevier.com/content/search/scopus", view = "COMPLETE", count = 25, headers = NULL, ... ) author_data( ..., verbose = TRUE, all_author_info = FALSE, general = TRUE, scrub = FALSE )
author_df( au_id = NULL, last_name = NULL, first_name = NULL, api_key = NULL, verbose = TRUE, all_author_info = FALSE, http = "https://api.elsevier.com/content/search/scopus", view = "COMPLETE", count = 25, general = TRUE, scrub = FALSE, headers = NULL, ... ) author_df_orig(..., general = FALSE) author_list( au_id = NULL, last_name = NULL, first_name = NULL, api_key = NULL, verbose = TRUE, http = "https://api.elsevier.com/content/search/scopus", view = "COMPLETE", count = 25, headers = NULL, ... ) author_data( ..., verbose = TRUE, all_author_info = FALSE, general = TRUE, scrub = FALSE )
au_id |
Author ID number. Overrides any first/last name argument |
last_name |
last name of author |
first_name |
first name of author |
api_key |
Elsevier API key |
verbose |
Print diagnostic messages |
all_author_info |
Should all author info be recorded instead of that just to the author given |
http |
Address for scopus api |
view |
type of view to give, see https://api.elsevier.com/documentation/ScopusSearchAPI.wadl |
count |
number of records to retrieve (below 25, see https://dev.elsevier.com/api_key_settings.html) |
general |
Should |
scrub |
Should 'scrub_identifier' be run on the identifier? |
headers |
Headers passed to |
... |
Arguments to be passed to |
List of entries from SCOPUS
The author_data
command will return the list of all
entries as well as
the data.frame
.
if (is_elsevier_authorized()) { res = author_df(last_name = "Muschelli", first_name = "John", verbose = FALSE) }
if (is_elsevier_authorized()) { res = author_df(last_name = "Muschelli", first_name = "John", verbose = FALSE) }
This function wraps generic_elsevier_api
to give a
retrieval of an author from the Elsevier Author Retrieval API
author_retrieval_id( id, identifier = c("author_id", "eid"), http_end = NULL, ... ) multi_author_retrieval( id, identifier = c("author_id", "eid"), http_end = NULL, ... ) author_retrieval( au_id = NULL, last_name = NULL, first_name = NULL, view = c("LIGHT", "STANDARD", "ENHANCED", "METRICS", "ENTITLED"), self_cite = c("include", "exclude"), http_end = NULL, verbose = TRUE, api_key = NULL, headers = NULL, ... )
author_retrieval_id( id, identifier = c("author_id", "eid"), http_end = NULL, ... ) multi_author_retrieval( id, identifier = c("author_id", "eid"), http_end = NULL, ... ) author_retrieval( au_id = NULL, last_name = NULL, first_name = NULL, view = c("LIGHT", "STANDARD", "ENHANCED", "METRICS", "ENTITLED"), self_cite = c("include", "exclude"), http_end = NULL, verbose = TRUE, api_key = NULL, headers = NULL, ... )
id |
Identifier for author |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to
|
au_id |
Author ID number. Overrides any first/last name argument |
last_name |
last name of author |
first_name |
first name of author |
view |
Which view to see. See https://api.elsevier.com/documentation/AuthorRetrievalAPI.wadl |
self_cite |
Should self-citations be included? |
verbose |
Print diagnostic messages |
api_key |
Elsevier API key |
headers |
Headers passed to |
List of elements, similar to
generic_elsevier_api
See https://api.elsevier.com/documentation/AuthorRetrievalAPI.wadl for documentation
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = author_retrieval(au_id = "40462056100", verbose = FALSE) x = author_retrieval_id("40462056100", identifier = "author_id", verbose = FALSE) } else { x = author_retrieval_id( "40462056100", identifier = "author_id", api_key_error = FALSE, verbose = FALSE) x = author_retrieval( au_id = "40462056100", api_key_error = FALSE, verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = author_retrieval(au_id = "40462056100", verbose = FALSE) x = author_retrieval_id("40462056100", identifier = "author_id", verbose = FALSE) } else { x = author_retrieval_id( "40462056100", identifier = "author_id", api_key_error = FALSE, verbose = FALSE) x = author_retrieval( au_id = "40462056100", api_key_error = FALSE, verbose = FALSE) }
Searches SCOPUS to get information about documents on an author.
author_search( au_id, api_key = NULL, http = "https://api.elsevier.com/content/search/author", count = 200, start = 0, verbose = TRUE, facets = "subjarea(sort=fd,count=350)", searcher = "AU-ID", max_count = Inf, view = c("STANDARD", "COMPLETE"), add_query = NULL, headers = NULL, wait_time = 0, ... )
author_search( au_id, api_key = NULL, http = "https://api.elsevier.com/content/search/author", count = 200, start = 0, verbose = TRUE, facets = "subjarea(sort=fd,count=350)", searcher = "AU-ID", max_count = Inf, view = c("STANDARD", "COMPLETE"), add_query = NULL, headers = NULL, wait_time = 0, ... )
au_id |
Author ID number |
api_key |
API Key for Elsevier |
http |
Address for scopus api |
count |
number of records to retrieve (below 200, see https://dev.elsevier.com/api_key_settings.html) |
start |
where should the records start gathering |
verbose |
Print diagnostic messages |
facets |
Facets sent in query. See https://dev.elsevier.com/api_docs.html |
searcher |
Identifier for author ID. Do not change unless you know exactly what the API calls for. |
max_count |
Maximum count of records to be returned. |
view |
type of view to give, see https://api.elsevier.com/documentation/AuthorSearchAPI.wadl |
add_query |
Things to add to the query parameter for the request |
headers |
additional headers to be added to
|
wait_time |
The time in seconds to wait across consecutive requests of a single search (when records > 25) |
... |
Arguments to be passed to the query list for
|
List of entries from SCOPUS
## Not run: author_search(au_id = "Smith", searcher = "affil(princeton) and authlast") berk = author_search(au_id = "berkeley", searcher = "affil", count =100) ## End(Not run)
## Not run: author_search(au_id = "Smith", searcher = "affil(princeton) and authlast") berk = author_search(au_id = "berkeley", searcher = "affil", count =100) ## End(Not run)
Searches SCOPUS to get information about authors with a certain affiliation
author_search_by_affil(affil_id, searcher = "AF-ID", ...)
author_search_by_affil(affil_id, searcher = "AF-ID", ...)
affil_id |
Affiliation ID number |
searcher |
Identifier for Affiliation ID. Do not change unless you know exactly what the API calls for. |
... |
Arguments to be passed to |
List of entries from SCOPUS
bibtex
entry from an output of
abstract_retrieval
or article_retrieval
Makes a bibtex
entry from an output of
abstract_retrieval
or article_retrieval
bibtex_core_data(x)
bibtex_core_data(x)
x |
output of |
A character vector of bibtex values
Adapted from https://github.com/pybliometrics-dev/pybliometrics/blob/master/pybliometrics/scopus/abstract_retrieval.py
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = abstract_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) res = bibtex_core_data(x) cat(res) x = abstract_retrieval("84929707579", identifier = "scopus_id", verbose = FALSE) res2 = bibtex_core_data(x) cat(res2) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = abstract_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) res = bibtex_core_data(x) cat(res) x = abstract_retrieval("84929707579", identifier = "scopus_id", verbose = FALSE) res2 = bibtex_core_data(x) cat(res2) }
SCOPUS Citation Retrieval
citation_retrieval( scopus_id = NULL, pii = NULL, doi = NULL, pubmed_id = NULL, date_range = NULL, exclude = NULL, ... ) parse_citation_retrieval(result)
citation_retrieval( scopus_id = NULL, pii = NULL, doi = NULL, pubmed_id = NULL, date_range = NULL, exclude = NULL, ... ) parse_citation_retrieval(result)
scopus_id |
Scopus Identifier |
pii |
Scopus Identifier |
doi |
Scopus Identifier |
pubmed_id |
PubMed Identifier |
date_range |
date range to specify, must be length 2 |
exclude |
either exclude-self or exclude-books for exclusion of citation |
... |
Arguments to be passed to |
result |
result from |
List of elements, similar to generic_elsevier_api
api_key = Sys.getenv("Elsevier_API_Interactive") set_api_key(api_key) if (!is.null(api_key) & nchar(api_key) > 0){ result = citation_retrieval(pii = c("S0140673616324102", "S0014579301033130"), verbose = FALSE) if (httr::status_code(result$get_statement) < 400) { res = parse_citation_retrieval(result) } } set_api_key(NULL)
api_key = Sys.getenv("Elsevier_API_Interactive") set_api_key(api_key) if (!is.null(api_key) & nchar(api_key) > 0){ result = citation_retrieval(pii = c("S0140673616324102", "S0014579301033130"), verbose = FALSE) if (httr::status_code(result$get_statement) < 400) { res = parse_citation_retrieval(result) } } set_api_key(NULL)
Take an individual SCOPUS entry and transform it to a data frame of affiliations
collapse_affil(affils, collapse = ";")
collapse_affil(affils, collapse = ";")
affils |
Data frame of affiliations to be collapsed
usually from |
collapse |
What should values be collapsed using as a separator |
A data.frame
of affiliation information
Get Complete Author Information and ID from Scopus
complete_multi_author_info(au_id = NULL, api_key = NULL, verbose = TRUE, ...)
complete_multi_author_info(au_id = NULL, api_key = NULL, verbose = TRUE, ...)
au_id |
vector of Author IDs |
api_key |
Elsevier API key |
verbose |
Print messages from specification |
... |
options to pass to |
List of information
Authenticate API Key and get Token
elsevier_authenticate( api_key = NULL, api_key_error = TRUE, choice = NULL, verbose = TRUE, headers = NULL, ... ) is_elsevier_guest(...) is_elsevier_authorized(...)
elsevier_authenticate( api_key = NULL, api_key_error = TRUE, choice = NULL, verbose = TRUE, headers = NULL, ... ) is_elsevier_guest(...) is_elsevier_authorized(...)
api_key |
Elsevier API key |
api_key_error |
Should there be an error if no API key? |
choice |
Choice of which registered See https://dev.elsevier.com/tecdoc_api_authentication.html |
verbose |
Print messages from specification |
headers |
Headers passed to |
... |
Additional arguments to send to |
List of content, the GET
request,
and the token
if (have_api_key()) { auth = elsevier_authenticate() }
if (have_api_key()) { auth = elsevier_authenticate() }
This function wraps generic_elsevier_api
to give a
retrieval of an Embase Entry from the Elsevier Embase Retrieval API
embase_retrieval( id, identifier = c("lui", "pii", "doi", "embase", "pubmed_id", "medline"), http_end = NULL, ... )
embase_retrieval( id, identifier = c("lui", "pii", "doi", "embase", "pubmed_id", "medline"), http_end = NULL, ... )
id |
Identifier for abstract |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = embase_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = embase_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
This function wraps generic_elsevier_api
to give a
retrieval of an entitlement from the Elsevier Text Entitlement API
entitlement_retrieval( id, identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id"), http_end = NULL, ... )
entitlement_retrieval( id, identifier = c("scopus_id", "eid", "doi", "pii", "pubmed_id"), http_end = NULL, ... )
id |
Identifier for entitlement |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = entitlement_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = entitlement_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
Take a SCOPUS entry and transform it to a data frame of affiliations
entries_to_affil_list(entries)
entries_to_affil_list(entries)
entries |
list of entries from SCOPUS,
usually from |
A data.frame
of affiliation information
Take a SCOPUS entry list and transform it to a data frame of citation and article information
entries_to_citation_df(entries)
entries_to_citation_df(entries)
entries |
list of entries from SCOPUS,
usually from |
A data.frame
of citation information
Converts a list of entries into a data.frame
of records
entries_to_df(entries, au_id = NULL, verbose = TRUE) entries_to_df2(entries, verbose = TRUE)
entries_to_df(entries, au_id = NULL, verbose = TRUE) entries_to_df2(entries, verbose = TRUE)
entries |
Entries from the output of a command |
au_id |
Author ID number. Overrides any first/last name argument |
verbose |
Print diagnostic messages |
Data frame of records
Take an individual SCOPUS entry and transform it to a data frame of affiliations
entry_to_affil(x, all_affils)
entry_to_affil(x, all_affils)
x |
individual entry from SCOPUS,
usually from |
all_affils |
Affiliation data.frame from |
A data.frame
of affiliation information
data.frame
sGenerally Convert Entries into a list of data.frame
s
gen_entries_to_df(entries, scrub = FALSE)
gen_entries_to_df(entries, scrub = FALSE)
entries |
Entries from the output of a command |
scrub |
Should 'scrub_identifier' be run on the identifier? |
List of data.frame
s from entries
Runs GET on generic Elsevier Search
generic_elsevier_api( query = NULL, type = c("search", "article", "entitlement", "recommendation", "object", "fragment", "abstract", "affiliation", "embase", "author", "serial", "nonserial", "subject", "holdings", "citation-count", "citations", "metadata", "ev", "ev_records", "analytics"), search_type = c("affiliation", "author", "scopus", "scidir", "scidir-object", "sciencedirect", "plumx"), api_key = NULL, headers = NULL, content_type = c("content", "feedback"), root_http = "https://api.elsevier.com", http_end = NULL, verbose = TRUE, api_key_error = TRUE, ... )
generic_elsevier_api( query = NULL, type = c("search", "article", "entitlement", "recommendation", "object", "fragment", "abstract", "affiliation", "embase", "author", "serial", "nonserial", "subject", "holdings", "citation-count", "citations", "metadata", "ev", "ev_records", "analytics"), search_type = c("affiliation", "author", "scopus", "scidir", "scidir-object", "sciencedirect", "plumx"), api_key = NULL, headers = NULL, content_type = c("content", "feedback"), root_http = "https://api.elsevier.com", http_end = NULL, verbose = TRUE, api_key_error = TRUE, ... )
query |
Query to run, not overall query, but 'queryParam' query |
type |
Type of search. See https://dev.elsevier.com/api_docs.html |
search_type |
Type of search if |
api_key |
Elsevier API key |
headers |
Headers passed to |
content_type |
Is the data content or feedback? |
root_http |
address to use for query |
http_end |
string to add to end of http specification
(done using |
verbose |
Print messages from specification |
api_key_error |
Should there be an error if no API key? |
... |
Options passed to queryParam for |
List of elements, content and the GET
request
## Not run: query_string = "affil(hopkins)" # Use affiliation query s = generic_elsevier_api(query = query_string, type = "search", search_type = "affiliation", api_key = api_key, verbose = FALSE) # Use author query s = generic_elsevier_api(query = query_string, type = "search", search_type = "author", api_key = api_key, verbose = FALSE) # Query abstract by pii s = generic_elsevier_api(query = "", type = "abstract", http_end = "pii/S1053811915002700", api_key = api_key, verbose = FALSE) ## End(Not run)
## Not run: query_string = "affil(hopkins)" # Use affiliation query s = generic_elsevier_api(query = query_string, type = "search", search_type = "affiliation", api_key = api_key, verbose = FALSE) # Use author query s = generic_elsevier_api(query = query_string, type = "search", search_type = "author", api_key = api_key, verbose = FALSE) # Query abstract by pii s = generic_elsevier_api(query = "", type = "abstract", http_end = "pii/S1053811915002700", api_key = api_key, verbose = FALSE) ## End(Not run)
Uses SCOPUS affiliation search to identify affiliation identification information
get_affiliation_info( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = FALSE, headers = NULL )
get_affiliation_info( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = FALSE, headers = NULL )
affil_id |
ID of affiliation |
affil_name |
name of affiliation |
api_key |
Elsevier API key |
verbose |
Print messages from specification |
headers |
Headers passed to |
A data.frame
of affiliation information
Get all Co-Authors
get_all_coauthors(...)
get_all_coauthors(...)
... |
arguments to pass to |
A list of output, incluing a vector of author_ids
## Not run: get_all_coauthors(last_name = "muschelli") ## End(Not run)
## Not run: get_all_coauthors(last_name = "muschelli") ## End(Not run)
Determines if option(elsevier_api_key)
or
option(elsevier_api_key_filename)
is set.
If not, it stops and returns an error. If so, returns the value.
get_api_key(api_key = NULL, error = TRUE) have_api_key(api_key = NULL)
get_api_key(api_key = NULL, error = TRUE) have_api_key(api_key = NULL)
api_key |
Elsevier API key |
error |
Should the function error if |
API key
You can either set the API key using
option(elsevier_api_key)
or have it accessible by
api_key = Sys.getenv('Elsevier_API')
.
res = get_api_key(error = FALSE)
res = get_api_key(error = FALSE)
Uses SCOPUS author search to identify author identification information in a workable format
get_author_info(...)
get_author_info(...)
... |
Arguments passed to |
Data.frame of information
## Not run: get_author_info(au_id = "40462056100") ## End(Not run)
## Not run: get_author_info(au_id = "40462056100") ## End(Not run)
Uses SCOPUS author search to identify author identification information
get_complete_author_info( last_name = NULL, first_name = NULL, affil_id = NULL, affil_name = NULL, api_key = NULL, http = "https://api.elsevier.com/content/search/author", query = NULL, count = 200, start = 0, verbose = TRUE, au_id = NULL, headers = NULL, ... )
get_complete_author_info( last_name = NULL, first_name = NULL, affil_id = NULL, affil_name = NULL, api_key = NULL, http = "https://api.elsevier.com/content/search/author", query = NULL, count = 200, start = 0, verbose = TRUE, au_id = NULL, headers = NULL, ... )
last_name |
last name of author |
first_name |
first name of author |
affil_id |
ID of affiliation (optional) |
affil_name |
name of affiliation |
api_key |
Elsevier API key |
http |
Author API http |
query |
Additional query info, added using |
count |
maximum number of records to retrieve |
start |
index to start on. Only necessary if a large number of records retrieved |
verbose |
Print messages from specification |
au_id |
Author ID number, will override first/last combination if specified |
headers |
Headers passed to |
... |
options to pass to |
List of information
if (is_elsevier_authorized()) { res = get_complete_author_info( last_name = "Muschelli", first_name = "John", verbose = FALSE) }
if (is_elsevier_authorized()) { res = get_complete_author_info( last_name = "Muschelli", first_name = "John", verbose = FALSE) }
Get Links for next/first/last query
get_links(result) get_url(result, type = c("self", "first", "prev", "next", "last")) next_url(result) last_url(result) prev_url(result) self_url(result) first_url(result) get_link_type(result, ..., type = c("self", "first", "prev", "next", "last")) get_first(result, ...) get_last(result, ...) get_prev(result, ...) get_next(result, ...) get_self(result, ...)
get_links(result) get_url(result, type = c("self", "first", "prev", "next", "last")) next_url(result) last_url(result) prev_url(result) self_url(result) first_url(result) get_link_type(result, ..., type = c("self", "first", "prev", "next", "last")) get_first(result, ...) get_last(result, ...) get_prev(result, ...) get_next(result, ...) get_self(result, ...)
result |
Object (list) with an element named |
type |
The type of link requested |
... |
Options passed to |
A data.frame
or a vector of characters
## Not run: result <- generic_elsevier_api( query = "ISSN(0004-3702) AND YEAR(2001)", search_type = "scopus") next_result = get_next(result) ## End(Not run)
## Not run: result <- generic_elsevier_api( query = "ISSN(0004-3702) AND YEAR(2001)", search_type = "scopus") next_result = get_next(result) ## End(Not run)
Add Institution or Authorization Token
inst_token_header(token) auth_token_header(token)
inst_token_header(token) auth_token_header(token)
token |
Elsevier API token, usually from
|
An object of class token
, but really a character
SCOPUS Citation Retrieval
metadata_retrieval(query = NULL, view = c("STANDARD", "COMPLETE"), ...)
metadata_retrieval(query = NULL, view = c("STANDARD", "COMPLETE"), ...)
query |
Query to run, not overall query, but 'queryParam' query |
view |
Type of view to have. See https://dev.elsevier.com/guides/ArticleMetadataViews.htm |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
generic_elsevier_api
,
https://dev.elsevier.com/documentation/ArticleMetadataAPI.wadl
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = metadata_retrieval(query = "heart attack", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = metadata_retrieval(query = "heart attack", verbose = FALSE) }
Get Relevant Authors Information from IDs from Scopus
multi_author_info(...) process_complete_multi_author_info(res)
multi_author_info(...) process_complete_multi_author_info(res)
... |
Arguments passed to |
res |
result from |
Data.frame of information
## Not run: multi_author_info(au_id = c("22968535800", "40462056100")) ## End(Not run)
## Not run: multi_author_info(au_id = c("22968535800", "40462056100")) ## End(Not run)
Removes NULL values from a vector from a list
nonull(x, replace = NA)
nonull(x, replace = NA)
x |
Vector from a list |
replace |
Value to replace NULL with |
Vector
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, ...)
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, ...)
id |
Identifier for object |
identifier |
Type of identifier to use |
ref |
document reference |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
res |
result from |
url |
url to download from |
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 |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) authorized = is_elsevier_authorized() if (have_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 ] } if (authorized) { 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)) } }
api_key = get_api_key(NULL, error = FALSE) authorized = is_elsevier_authorized() if (have_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 ] } if (authorized) { 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)) } }
Retrieve PlumX metrics for Scopus documents and other related artifacts
plumx_metrics(value, type = plumx_types(), ...) plumx_types()
plumx_metrics(value, type = plumx_types(), ...) plumx_types()
value |
The value of the identifier to search for. |
type |
The type of identifier to search for. |
... |
Additional arguments to pass to |
List of elements, content and the GET
request
See https://dev.elsevier.com/documentation/PlumXMetricsAPI.wadl for more information
if (have_api_key()) { type = "doi" value = "10.1016/j.nicl.2018.10.013" res = plumx_metrics(value, type) }
if (have_api_key()) { type = "doi" value = "10.1016/j.nicl.2018.10.013" res = plumx_metrics(value, type) }
Print method for Scopus API key
## S3 method for class 'scopus_api_key' print(x, reveal = FALSE, ...)
## S3 method for class 'scopus_api_key' print(x, reveal = FALSE, ...)
x |
an object used to select a method. |
reveal |
Should the API key be revealed |
... |
further arguments passed to or from other methods |
x = "asdf" class(x) = "scopus_api_key" print(x) print(x, reveal = TRUE)
x = "asdf" class(x) = "scopus_api_key" print(x) print(x, reveal = TRUE)
Print method for token
## S3 method for class 'token' print(x, reveal = FALSE, ...) reveal(x, ...)
## S3 method for class 'token' print(x, reveal = FALSE, ...) reveal(x, ...)
x |
an object used to select a method. |
reveal |
Should the token be revealed |
... |
further arguments passed to or from other methods |
x = "asdf" class(x) = "token" print(x) print(x, reveal = TRUE)
x = "asdf" class(x) = "token" print(x) print(x, reveal = TRUE)
Process Affiliation ID and names for generic use
process_affiliation_name( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE )
process_affiliation_name( affil_id = NULL, affil_name = NULL, api_key = NULL, verbose = TRUE )
affil_id |
Affiliation ID number. |
affil_name |
affiliation name |
api_key |
Elsevier API key |
verbose |
Print diagnostic messages |
List of affiliation name and affiliation ID
Process author ID and names for generic use
process_author_name( au_id = NULL, last_name = NULL, first_name = NULL, affil_id = NULL, api_key = NULL, verbose = TRUE, headers = NULL )
process_author_name( au_id = NULL, last_name = NULL, first_name = NULL, affil_id = NULL, api_key = NULL, verbose = TRUE, headers = NULL )
au_id |
Author ID number. Overrides any first/last name argument |
last_name |
last name of author |
first_name |
first name of author |
affil_id |
ID of affiliation (optional) |
api_key |
Elsevier API key |
verbose |
Print diagnostic messages |
headers |
Headers passed to |
List of first/last name and author ID
This function is really to avoid duplication
Read Citation Overview (CTO) File
read_cto(file) read_cto_long(file)
read_cto(file) read_cto_long(file)
file |
CSV of CTO export from Scopus |
A list of the data, year columns, and header information
file = system.file("extdata", "CTOExport.csv", package = "rscopus") citations_over_time = read_cto(file) citations_over_time = citations_over_time$data
file = system.file("extdata", "CTOExport.csv", package = "rscopus") citations_over_time = read_cto(file) citations_over_time = citations_over_time$data
This function wraps generic_elsevier_api
to give a
retrieval of a recommendation from the Elsevier Article Recommendation API
recommendation_retrieval( id, identifier = c("eid", "pii"), http_end = NULL, ... )
recommendation_retrieval( id, identifier = c("eid", "pii"), http_end = NULL, ... )
id |
Identifier for recommendation |
identifier |
Type of identifier to use |
http_end |
any additional end to http statement.
See |
... |
Arguments to be passed to |
List of elements, similar to generic_elsevier_api
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = recommendation_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
api_key = get_api_key(NULL, error = FALSE) if (!is.null(api_key)){ x = recommendation_retrieval("S1053811915002700", identifier = "pii", verbose = FALSE) }
Replaces non-ASCII characters from a last or first name
replace_non_ascii(string)
replace_non_ascii(string)
string |
Character vector of values to be replaced |
Character vector
This function wraps generic_elsevier_api
to give a
scopus search from the Elsevier Scopus Search API
Searches SCOPUS to get information about documents on an author.
scopus_search( query, api_key = NULL, count = 200, view = c("STANDARD", "COMPLETE"), start = 0, verbose = TRUE, max_count = 20000, http = "https://api.elsevier.com/content/search/scopus", headers = NULL, wait_time = 0, ... ) sciencedirect_search(count = 100, ...) scidir_search(count = 100, ...)
scopus_search( query, api_key = NULL, count = 200, view = c("STANDARD", "COMPLETE"), start = 0, verbose = TRUE, max_count = 20000, http = "https://api.elsevier.com/content/search/scopus", headers = NULL, wait_time = 0, ... ) sciencedirect_search(count = 100, ...) scidir_search(count = 100, ...)
query |
Query string to search on SCOPUS |
api_key |
API Key for Elsevier |
count |
number of records to retrieve (below 200 for STANDARD, below 25 for COMPLETE views, see https://dev.elsevier.com/api_key_settings.html). |
view |
type of view to give, see https://api.elsevier.com/documentation/ScopusSearchAPI.wadl |
start |
where should the records start gathering |
verbose |
Print diagnostic messages |
max_count |
Maximum count of records to be returned. |
http |
Address for scopus API |
headers |
additional headers to be added to
|
wait_time |
The time in seconds to wait across consecutive requests of a single search (when records > 25) |
... |
Arguments to be passed to the query list for
|
List of entries from SCOPUS
if (have_api_key()) { authorized = is_elsevier_authorized() if (authorized) { res = scopus_search(query = "all(gene)", max_count = 20, count = 10) df = gen_entries_to_df(res$entries) head(df$df) sci_res = sciencedirect_search(query = "heart+attack AND text(liver)", max_count = 30, count = 25) sci_df = gen_entries_to_df(sci_res$entries) Sys.sleep(2) nt = sciencedirect_search(query = "title(neurotoxin)", max_count = 20, count = 10, wait_time = 1) nt_df = gen_entries_to_df(nt$entries) nt_df = nt_df$df } }
if (have_api_key()) { authorized = is_elsevier_authorized() if (authorized) { res = scopus_search(query = "all(gene)", max_count = 20, count = 10) df = gen_entries_to_df(res$entries) head(df$df) sci_res = sciencedirect_search(query = "heart+attack AND text(liver)", max_count = 30, count = 25) sci_df = gen_entries_to_df(sci_res$entries) Sys.sleep(2) nt = sciencedirect_search(query = "title(neurotoxin)", max_count = 20, count = 10, wait_time = 1) nt_df = gen_entries_to_df(nt$entries) nt_df = nt_df$df } }
Sets Elsevier API key using
if option(elsevier_api_key)
set_api_key(api_key)
set_api_key(api_key)
api_key |
Elsevier API key |
Subject Areas
subject_areas() subject_area_codes()
subject_areas() subject_area_codes()
Character vector of subject areas
See https://service.elsevier.com/app/answers/detail/a_id/15181/supporthub/scopus/related/1/