Learn R Programming

rClinicalCodes (version 1.0.1)

codelist_keywords: Extract keywords from clinical code lists

Description

This function takes a dataframe of clinical codes and gives a vector of keywords, sorted by frequency

Usage

codelist_keywords(codelist, keyword_column = "description", extra_stopwords = NULL)

Arguments

codelist
a dataframe of clinical codes, such as downloaded using the get_ClinicalCodes function
keyword_column
The column of the dataframe to extract keywords from
extra_stopwords
an optional character vector of further stopwords to remove

Value

character vector of keywords, sorted by frequency in the list

Details

All terms are converted to lower case. Common stopwords, whitespace and punctuation are removed Optional extra_stopwords vector

Examples

Run this code
## Not run: 
# # Get codelist from url:
# angina_codes <- get_ClinicalCodes(
# url = "https://clinicalcodes.rss.mhs.man.ac.uk/medcodes/article/6/codelist/angina/download/")
# codelist_keywords(angina_codes, extra_stopwords = c("good", "poor", "[x]"))
# ## End(Not run)

Run the code above in your browser using DataLab