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.
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.
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.