export: Export Dictionary Lookup Tables

Description Usage Arguments Details Author(s) References See Also Examples

Description

Exports the singlewords, multiwords, patterns and lookups dictionaries to .csv files.

Usage

1
2
3
4
5
6
7
8
9
export(x, ...)
## S3 method for class 'drugdose_singlewords'
export(x, filename)
## S3 method for class 'drugdose_multiwords'
export(x, filename)
## S3 method for class 'drugdose_patterns'
export(x, filename)
## S3 method for class 'drugdose_lookups'
export(x, filename)

Arguments

x

An R object of class drugdose_singlewords, drugdose_multiwords, drugdose_patterns or drugdose_lookups.

filename

Name of .csv file to export to.

...

Generic arguments for export method.

Details

Exports the dictionary as a comma separated values text file.

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, addterm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Testing singlewords roundtrip
data(singlewords)
old_singlewords <- as.drugdose_singlewords(singlewords)
export(old_singlewords, paste(tempdir(),
	'singlewords.csv', sep = '/'))
new_singlewords <- as.drugdose_singlewords(paste(tempdir(),
	'singlewords.csv', sep = '/'))
str(new_singlewords)

# Testing multiwords roundtrip
data(multiwords)
old_multiwords <- as.drugdose_multiwords(multiwords)
export(old_multiwords, paste(tempdir(),
	'multiwords.csv', sep = '/'))
new_multiwords <- as.drugdose_multiwords(paste(tempdir(),
	'multiwords.csv', sep = '/'))
str(new_multiwords)

# Testing patterns roundtrip
data(patterns)
old_patterns <- as.drugdose_patterns(patterns)
export(old_patterns, paste(tempdir(),
	'patterns.csv', sep = '/'))
new_patterns <- as.drugdose_patterns(paste(tempdir(),
	'patterns.csv', sep = '/'))
str(new_patterns)

CALIBERdrugdose documentation built on May 2, 2019, 6:49 p.m.