get_recordId_externalreferences: Get external references of a record ID

Description Usage Arguments Details Value See Also Examples

View source: R/RECORDS-get_recordId_externalreferences.R

Description

GET a list of external references for a ChemSpider ID.

Usage

1
2
3
4
5
6
get_recordId_externalreferences(
  recordId,
  dataSources = NULL,
  apikey,
  coerce = FALSE
)

Arguments

recordId

A valid (integer) ChemSpider ID.

dataSources

Either a character string, a vector of characters, or a list of characters detailing which dataSources to look up. If left as is, will return all dataSources.

apikey

A 32-character string with a valid key for ChemSpider's API services.

coerce

logical: should the list be coerced to a data.frame? Defaults to FALSE.

Details

It is recommended to specify which dataSources to load, as some substances have a substantial amount of references (>10'000). Use chemspiderapi::get_datasources() for a complete list of the >350 dataSources.

Value

Either a data frame (if no options are dropped) or a character/integer vector, depending on the external ID.

See Also

https://developer.rsc.org/compounds-v1/apis/get/records/{recordId}/externalreferences

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Get the PubChem external reference for caffeine
recordId <- 2424L
dataSources <- "PubChem"
apikey <- "a valid 32-character ChemSpider apikey"
get_recordId_externalreferences(recordId = recordId, dataSources = dataSources, apikey = apikey)

## End(Not run)

NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.