compress_lookup {DOPE}R Documentation

Collapse Redundant Rows of a Lookup Table

Description

Given a Drug Lookup table as returned by the function lookup, collapse rows from unwanted columns

Usage

compress_lookup(
  lookupTable,
  compressOriginalWord = FALSE,
  compressClass = FALSE,
  compressCategory = FALSE,
  compressSynonym = TRUE
)

Arguments

lookupTable

A lookup table with category data.frame having three columns: drug class, drug category, and drug street name. These tables are returned by the function lookup.

compressOriginalWord

Should the search word(s) be collapsed? Defaults to FALSE.

compressClass

Should the drug class be collapsed? Defaults to FALSE.

compressCategory

Should the drug category be collapsed? Defaults to FALSE.

compressSynonym

Should the drug synonym / street name be collapsed? Defaults to TRUE.

Value

A compressed lookup table, with unwanted columns removed.

Examples

  longExampleTable <- lookup("dope", "methamphetamine")
  compress_lookup(longExampleTable)
  compress_lookup(longExampleTable, compressCategory = TRUE)

[Package DOPE version 2.1.0 Index]