extr_casrn_from_cid | R Documentation |
This function retrieves the CASRN for a given set of PubChem Compound Identifiers (CID).
It queries PubChem through the webchem
package and extracts the CASRN from
the depositor-supplied synonyms.
extr_casrn_from_cid(pubchem_ids, verbose = TRUE)
pubchem_ids |
A numeric vector of PubChem CIDs. These are unique identifiers for chemical compounds in the PubChem database. |
verbose |
A logical value indicating whether to print detailed messages. Default is TRUE. |
A data frame containing the CID, CASRN, and IUPAC name of the compound. The returned data frame includes three columns:
The PubChem Compound Identifier.
The corresponding CASRN of the compound.
The IUPAC name of the compound.
The pubchem_id queried.
# Example with formaldehyde and aflatoxin
cids <- c(712, 14434) # CID for formaldehyde and aflatoxin B1
extr_casrn_from_cid(cids)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.