Given a Drug Lookup table as returned by the function
lookup
, collapse rows from unwanted columns
compress_lookup( lookupTable, compressOriginalWord = FALSE, compressClass = FALSE, compressCategory = FALSE, compressSynonym = TRUE )
lookupTable | A lookup table with category |
---|---|
compressOriginalWord | Should the search word(s) be collapsed? Defaults to
|
compressClass | Should the drug class be collapsed? Defaults to
|
compressCategory | Should the drug category be collapsed? Defaults to
|
compressSynonym | Should the drug synonym / street name be collapsed?
Defaults to |
A compressed lookup table, with unwanted columns removed.
#> original_word class category #> 1 dope heroin heroin #> 2 dope cannabis marijuana #> 3 methamphetamine stimulant methamphetaminecompress_lookup(longExampleTable, compressCategory = TRUE)#> original_word class #> 1 dope heroin #> 2 dope cannabis #> 3 methamphetamine stimulant