R package for hierarchical clustering of medications based on ATC, timing, and dosage.
This manual describes the R package 'tame', which performs agglomerative hierarchical clustering of medications using ATC codes, timing, and dosage. It includes functions for clustering, summarizing, and applying clusters to new data. The package is designed for researchers and analysts working with pharmaceutical data.
The core function, 'medic()', creates clusters based on customizable parameters such as number of clusters, linkage method, and distance measures. Additional functions like 'employ()' and 'enrich()' allow users to apply existing clusters to new datasets or enrich cluster metadata with external data.
| Version | 0.0.1 |
|---|---|
| Depends | R (>= 4.2) |
| Imports | dplyr, fuzzyjoin, magrittr, purrr, Rfast, rlang, stats, stringr, tibble, tidyr, tidyselect, Rcpp (>= 1.0.8) |
The main function, 'medic()', performs agglomerative hierarchical clustering of medications based on ATC codes, timing, and dosage.
It uses agglomerative hierarchical clustering with a bespoke distance measure based on medication ATC codes similarities, medication timing and medication amount or dosage.
The default linkage method is 'complete'.
The default summation method is 'sum_of_minima'.