extr_pubchem_ghs {extractox} | R Documentation |
Extract GHS Codes from PubChem
Description
This function extracts GHS (Globally Harmonized System) codes from PubChem.
It relies on the webchem
package to interact with PubChem.
Usage
extr_pubchem_ghs(casrn, verbose = TRUE, delay = 0)
Arguments
casrn |
Character vector of CAS Registry Numbers (CASRN). |
verbose |
A logical value indicating whether to print detailed messages. Default is TRUE. |
delay |
A numeric value indicating the delay (in seconds) between API requests. This controls the time between successive PubChem queries. Default is 0. See Details for more info. |
Details
The function performs two queries to PubChem:
The first query retrieves the PubChem Compound Identifier (CID) for each IUPAC name.
The second query retrieves additional information using the obtained CIDs. In cases of multiple rapid successive requests, the PubChem server may deny access. Introducing a delay between requests (using the
delay
parameter) can help prevent this issue.
Value
A dataframe containing GHS information.
See Also
Examples
extr_pubchem_ghs(casrn = c("50-00-0", "64-17-5"))