singlewords: Lookup Table for Replacing Individual Words

singlewordsR Documentation

Lookup Table for Replacing Individual Words

Description

A table of replacements for words that may be found in dosage texts. This enables different forms of the same word (e.g. tab, tablet, tabs) to be converted to a standardised form, to facilitate downstream processing. The table is converted to a named character vector by as.drugdose_singlewords for use in analysis.

Usage

data(singlewords)

Format

A data frame with observations on the following 2 variables.

replacement

character; replacement for words. If missing (NA), the word is left as it is (equivalent to setting replacement equal to words .

words

character; a single word

Details

Each entry in the 'words' column must be unique and must be a single word or punctuation character.

References

Shah AD, Martinez C. An algorithm to derive a numerical daily dose from unstructured text dosage instructions. Pharmacoepidemiol Drug Saf 2006; 15(3): 161-166. doi: 10.1002/pds.1151 http://onlinelibrary.wiley.com/doi/10.1002/pds.1151/

Examples

data("singlewords")

# Convert to singlewords dictionary for analysis
singlewords <- as.drugdose_singlewords(singlewords)

CALIBERdrugdose documentation built on July 4, 2024, 3:01 p.m.