get_recordId_mol: Get the MOL file of a ChemSpider record

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

View source: R/RECORDS-get_recordId_mol.R

Description

This function is used to download a single .MOL file from ChemSpider.

Usage

1
get_recordId_mol(recordId, apikey, simplify = FALSE)

Arguments

recordId

A valid (integer) ChemSpider ID.

apikey

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

simplify

logical: should the results be simplified to a vector? Defaults to FALSE.

Details

"If successful, returns a SDF file containing the single record for the matching record."

Call this endpoint with recordId as an integer. To save the MOL/SDF file, see the vignette "Saving MOL Files of Chemicals".

Value

A character string containing the (human-readable) .MOL file.

Author(s)

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

See Also

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

Examples

1
2
3
4
5
6
7
## Not run: 
## Get the MOL file for caffeine
recordId <- 2424L
apikey <- "a valid 32-character ChemSpider apikey"
get_recordId_mol(recordId = recordId, apikey = apikey)

## End(Not run)

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