webchem (version 1.1.1)

cs_compinfo: Retrieve record details by ChemSpider ID

Description

Submit a ChemSpider ID (CSID) and the fields you are interested in, and retrieve the record details for your query.

Usage

cs_compinfo(csid, fields, verbose = TRUE, apikey = NULL)

Arguments

csid

numeric; can be obtained using get_csid

fields

character; see details.

verbose

logical; should a verbose output be printed on the console?

apikey

character; your API key. If NULL (default), cs_check_key() will look for it in .Renviron or .Rprofile.

Value

Returns a data frame.

Details

Valid values for fields are "SMILES", "Formula", "InChI", "InChIKey", "StdInChI", "StdInChIKey", "AverageMass", "MolecularWeight", "MonoisotopicMass", "NominalMass", "CommonName", "ReferenceCount", "DataSourceCount", "PubMedCount", "RSCCount", "Mol2D", "Mol3D". You can specify any number of fields.

References

https://developer.rsc.org/compounds-v1/apis

Examples

Run this code
# NOT RUN {
cs_compinfo(171, c("SMILES", "CommonName"))
cs_compinfo(171:182, "SMILES")
# }

Run the code above in your browser using DataLab