I can find out if the compounds I have in a list belong to an organism using Keggrest.
library(keggrest) find_organism <- function(compounds) { organism <- NULL for (i in compounds) { tryCatch({ res <- kegg_search(i)$org }, warning = function(warn) { res <- NULL }) organism <- append(organism, res) } organism <- unique(organism) }