The goal of DOPE is to provide a structured vocabulary and tools to look up details on drugs tracked by the DEA. The data structure is:
You can install the released version of DOPE from CRAN with:
You can look up details on a drug with the
lookup() function. It will check brand, generic and street names.
The lookup funciton supports vectorized lookups:
library(DOPE) lookup("cheese", "pizza", "with", "a", "soda") lookup(c("Buprenorphine", "Tramadol", "Bup/Nx"))
If your only care about the class and/or category and/or if you search returns many matches you can use the compress_lookup() function to drop columns and then remove duplicate rows.
lookup("cheese", "pizza", "with", "a", "soda") %>% compress_lookup(compressClass = FALSE, compressCategory = TRUE, compressSynonym = TRUE)