get_recordId_details: Get details for a ChemSpider record

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RECORDS-get_recordId_details.R

Description

This function returns record details from ChemSpider.

Usage

1
2
3
4
5
6
7
8
get_recordId_details(
  recordId,
  fields = "all",
  apikey,
  id = TRUE,
  simplify_formula = FALSE,
  coerce = FALSE
)

Arguments

recordId

A valid (integer) ChemSpider ID.

fields

Either a single character string, a character vector, or a character list stating which fields to return. Alternatively, "all" returns all possible fields. fields is NOT case sensitive, but see details for a list of possible entries.

apikey

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

id

logical: Should the id column (i.e., the recordId) be part of the output? Defaults to TRUE.

simplify_formula

logical: Should formula strings be simplified? Defaults to FALSE.

coerce

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

Details

"Call this endpoint with a Record ID as an integer.

The available fields are: SMILES, Formula, InChI, InChIKey, StdInChI, StdInChIKey, AverageMass, MolecularWeight, MonoisotopicMass, NominalMass, CommonName, ReferenceCount, DataSourceCount, PubMedCount, RSCCount, Mol2D, Mol3D."

Value

A data.frame if multiple columns are returned, or a vector of the appropriate type if only one field is returned.

Author(s)

Raoul Wolf (https://github.com/RaoulWolf/)

See Also

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

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
## Get the record details for caffeine
recordId <- 2424L
apikey <- "A valid 32-character Chemspider API key"
get_recordId_details(recordId = recordId, 
                     fields = c("SMILES", "Formula", "MolecularWeight", "CommonName"), 
                     apikey = apikey)

## End(Not run)

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