extr_pubchem_fema {extractox} | R Documentation |
Extract FEMA from PubChem
Description
This function retrieves FEMA (Flavor and Extract Manufacturers Association)
flavor profile information for a list of CAS Registry Numbers (CASRN) from
the PubChem database using the webchem
package.
Usage
extr_pubchem_fema(casrn, verbose = TRUE, delay = 0)
Arguments
casrn |
A vector of CAS Registry Numbers (CASRN) as atomic vectors. |
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 data frame containing the FEMA flavor profile information for each CASRN. If no information is found for a particular CASRN, the output will include a row indicating this.
See Also
Examples
extr_pubchem_fema(c("83-67-0", "1490-04-6"))