as.drugdose_singlewords: Import or convert a drugdose_singlewords table

View source: R/importexport.R

as.drugdose_singlewordsR Documentation

Import or convert a drugdose_singlewords table

Description

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

Usage

as.drugdose_singlewords(singlewords)

Arguments

singlewords

Either a drugdose_singlewords 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:

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

Value

A named character vector with class drugdose_singlewords.

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(singlewords)

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

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