An alternative is to use OmnipathR::translate_ids
(developed by me):
library(OmnipathR)
library(magrittr)
metabolites <- data.frame(name = c('Malic acid', 'Bilirubin', 'Cortisol', 'Cytidine'))
metabolites %>% translate_ids(name, hmdb, kegg, hmdb = TRUE, entity_type = 'metabolite')
name hmdb kegg
1 Malic acid HMDB0000156 C00149
2 Bilirubin HMDB0000054 C00486
3 Cortisol HMDB0000063 C00735
4 Cytidine HMDB0000089 C00475
Above we use the "name" field from HMDB, which is the preferred name for each record. But a lot more name varieties are available under "synonyms". I recommend to look also there if you don't find your IDs by "name":
metabolites %>% translate_ids(name = synonym, hmdb, kegg, hmdb = TRUE, entity_type = 'metabolite')
name hmdb kegg
1 Malic acid HMDB0000156 C00149
2 Bilirubin HMDB0240584
3 Cortisol <NA> <NA>
4 Cytidine <NA> <NA
I recommend to install the latest version of OmnipathR from GitHub:
remotes::install_github('saezlab/OmnipathR')
Next time you post please use a more informative title that relates to the issue you are experiencing or minmally the package you wish to ask questions about. Have you looked at the metaboliteIDmapping landing page. That page contains the man pages for the package and a vignette that should get you started. You might also consider the KEGGREST and possible MetaboSignal. You can search for biocViews terms of interest to see other related packages on software page