extract_keywords: Function to extract rows from a lookup table based on...

Description Usage Arguments Details Value Examples

Description

This function can be used to build draft clinical code lists based on a clinical or product lookup table and a set of keywords.

Usage

1
extract_keywords(lookup, keywords, keyword_field = "desc")

Arguments

lookup

a dataframe containing a lookup table

keywords

character vector containing the keyword terms to search for

keyword_field

character identifying the field in the lookup table to be searched for keywords

Details

See www.clinicalcodes.org for clinical code lists that have been used in previous studies

All keywords are collapsed together in an OR statement

Value

a data frame subsetted by keyword

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
keywords <- c('oral ulceration', 'mouth ulceration', 'aphthous ulceration',
'oral aphthous ulceration','oral ulcer[s]?', 'mouth ulcer[s]?', 'aphthous ulcer[s]?',
'aphthous stomatitis', "stomatitis", "aphthae", 'oral aphthous stomatitis',
'oral aphthous ulcers', 'recurrent oral ulcers', 'recurrent mouth ulcers',
'recurrent oral aphthous ulcers', 'recurrent aphthous ulcers', 'recurrent aphthous stomatitis',
'recurrent oral aphthous stomatitis')
a <- extract_keywords(medical, keywords)

## End(Not run)

rosap/test documentation built on May 27, 2019, 11:30 p.m.