as.drugdose_multiwords: Import or Convert a drugdose_multiwords Table

View source: R/importexport.R

as.drugdose_multiwordsR Documentation

Import or Convert a drugdose_multiwords Table

Description

Converts its argument into an object of the class drugdose_multiwords for use by the dose conversion algorithm.

Usage

as.drugdose_multiwords(multiwords)

Arguments

multiwords

Either a drugdose_multiwords object (in which case it is returned unchanged), a data.frame, data.table or filename of a csv file in the appropriate format, see 'Details' below.

Details

The data.frame, data.table or file should have the following columns:

words

character; regular expression to match dosage text in a standardised format (one space between words, no capitals)

replacement

character; replacement text

comments

character; comments

order

numeric; order in which the rules are applied

Value

A data.frame with class drugdose_multiwords.

Author(s)

Anoop Shah

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/

See Also

as.drugdose_singlewords, as.drugdose_multiwords as.drugdose_patterns, as.drugdose_lookups, export, addterm

Examples

data(multiwords)

# Convert to multiwords dictionary for analysis
multiwords <- as.drugdose_multiwords(multiwords)

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