| dxCustom | R Documentation | 
Researches can define the grouping categories and therefore have more flexible for grouping ICD diagnostic codes.
icdDxToCustom(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  customGroupingTable
)
icdDxToCustomGrep(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  customGroupingTable
)
dxDataFile | 
 A data frame object of clinical diagnostic data with at least 3 columns: ID, ICD, and Date. As for date column, the data format should be YYYY/MM/DD or YYYY-MM-DD.  | 
idColName | 
 Column name of ID column in dxDataFile. Data type of this argumant should be string without quotation marks.  | 
icdColName | 
 Column name of ICD column in dxDataFile. Data type of this argumant should be string without quotation marks.  | 
dateColName | 
 Column name of date column in dxDataFile, and the type of date column should be a date format in R or a string format with date information in YYYY/MM/DD or YYYY-MM-DD. Data type of this argumant should be string without quotation marks.  | 
customGroupingTable | 
 Used-defined grouping categories.   | 
There are two functions for customized defined grouping method, the customized category grouping is based on precise ('icdDxToCustom') and fuzzy ('icdDxToCustomGrep') grouping method, respectively.
Two new data.tables. 1) groupedDT: Based on dxDataFile with two new columns for uniform format diagnostic codes and classified standard categories. 2) summarised_groupedDT: Summarized the dataset  groupedDT and sorted by memberID.
Other code classification functions: dxPheWAS, dxComorbid, DxCCS
# sample file for example
head(sampleDxFile)
# Group diagnostic codes into "Chronic kidney disease" with precise grouping method
groupingTable <- data.frame(Group = rep("Chronic kidney disease",6),
                            ICD = c("N181","5853","5854","5855","5856","5859"),
                            stringsAsFactors = FALSE)
icdDxToCustom(sampleDxFile, ID, ICD, Date, customGroupingTable = groupingTable)
# Group diagnostic codes into "Chronic kidney disease" with fuzzy grouping method
grepTable <- data.frame(Group = "Chronic kidney disease",
                        grepIcd = "^585|^N18",
                        stringsAsFactors = FALSE)
icdDxToCustomGrep(sampleDxFile, ID, ICD, Date, customGroupingTable = grepTable)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.