Package: AdhereR 0.8.3

AdhereR: Adherence to Medications

Computation of adherence to medications from Electronic Health care Data and visualization of individual medication histories and adherence patterns. The package implements a set of S3 classes and functions consistent with current adherence guidelines and definitions. It allows the computation of different measures of adherence (as defined in the literature, but also several original ones), their publication-quality plotting, the estimation of event duration and time to initiation, the interactive exploration of patient medication history and the real-time estimation of adherence given various parameter settings. It scales from very small datasets stored in flat CSV files to very large databases and from single-thread processing on mid-range consumer laptops to parallel processing on large heterogeneous computing clusters. It exposes a standardized interface allowing it to be used from other programming languages and platforms, such as Python.

Authors:Dan Dediu [aut, cre], Alexandra L. Dima [aut], Samuel Allemann [aut]

AdhereR_0.8.3.tar.gz
AdhereR_0.8.3.zip(r-4.7)AdhereR_0.8.3.zip(r-4.6)AdhereR_0.8.3.zip(r-4.5)
AdhereR_0.8.3.tgz(r-4.6-any)AdhereR_0.8.3.tgz(r-4.5-any)
AdhereR_0.8.3.tar.gz(r-4.7-any)AdhereR_0.8.3.tar.gz(r-4.6-any)
AdhereR_0.8.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
AdhereR/json (API)

# Install 'AdhereR' in R:
install.packages('AdhereR', repos = c('https://ddediu.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ddediu/adherer/issues

Datasets:

On CRAN:

Conda:

adherence-to-medicationselectronic-healthcare-datahadoopmedical-databasesmedication-historiespythonsqlvisualisation

8.09 score 31 stars 1 packages 99 scripts 734 downloads 5 mentions 35 exports 9 dependencies

Last updated from:bf26c687aa. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING173
source / vignettesOK250
linux-release-x86_64WARNING154
macos-release-arm64WARNING92
macos-oldrel-arm64WARNING112
windows-develWARNING118
windows-releaseWARNING116
windows-oldrelWARNING116
wasm-releaseOK129

Exports:callAdhereRCMA_per_episodeCMA_polypharmacyCMA_sliding_windowCMA0CMA1CMA2CMA3CMA4CMA5CMA6CMA7CMA8CMA9compute_event_durationscompute.event.int.gapscompute.treatment.episodescover_special_periodsget.event.plotting.areaget.legend.plotting.areaget.plotted.eventsget.plotted.partial.cmasgetCallerWrapperLocationgetCMAgetEventInfogetEventsToEpisodesMappinggetEventsToSlidingWindowsMappinggetInnerEventInfogetMGslast.plot.get.infomap.event.coords.to.plotplot_interactive_cmaprune_event_durationssubsetCMAtime_to_initiation

Dependencies:cpp11data.tablegenericsjpeglubridatepngrsvgtimechangewebp

Calling AdhereR from Python 3
Overview | Table of Contents | General ideas | Fundamentals of calling AdhereR from Python 3 | The Python 3 wrapper: the adherer module | Making the adherer module visible to Python (aka installation) | Importing the adherer module and initializations | The class hierarchy | The CallAdhereRError exception class | The base class CMA0 | Class CMA1 and its daughter classes CMA2, CMA3 and CMA4 | Class CMA5 and its daughter classes CMA6, CMA7, CMA8 and CMA9 | Classes CMAPerEpisode and CMASlidingWindow | Examples of use | Basic usage | Importing adherer and checking autodetection | Export the test dataset from R and import it in Python | Compute and plot test CMA | Interactive plotting | From a Jupyter Notebook | Parallel processing (locally and on different machines) | Single thread on the local machine | R | Python 3 | Multi-threaded on the local machine | Parallel on remote machines over a network | Some caveats for over-the-network distributed computation | Appendix I: the communication protocol | Context | Protocol | PARAMETERS[^1] | COMMENTS | SPECIAL PARAMETERS[^2] | FUNCTIONS | PLOTTING | CMA1, CMA2, CMA3, CMA4 | CMA5, CMA6, CMA7, CMA8, CMA9 | CMA_per_episode | CMA_sliding_window | compute_event_int_gaps | compute_treatment_episodes | plot_interactive_cma | Appendix II: the Python 3 code | Notes

Last update: 2026-06-22
Started: 2019-12-20

AdhereR: Adherence to Medications
Definitions | Data preparation and example dataset | Visualization of patient records | Persistence -- treatment episodes | Adherence -- continuous multiple interval measures of medication availability/gaps (CMA) | The simple CMAs | CMA1 | CMA2 | CMA3 and CMA4 | CMA5 and CMA6 | CMA7 | CMA8 | CMA9 | The iterated CMAs | CMA per episode | Sliding-window CMA | Mapping events to episodes and sliding windows | Interactive plotting | Computing event duration from prescription, dispensing, and hospitalization data | Computing time to initiation | Defining medication groups | Working with very large databases | Using AdhereR from other programming languages and platforms | AdhereR is pipe (%>% or |>)-friendly | Modifying AdhereR plots a posteriori | Plot CMA7 for patients 5 and 8: | Access the plotting info: | Let's add a vertical line for patient 8 between the medication change: | Find the event where the medication changes: | Half-way between the events where medication changes: | Draw the line: | Put a star * next to the 4th event of patient 5: | Find the event: | Plot the star: | Add some random text over the figure:

Last update: 2026-01-15
Started: 2019-12-20

Using AdhereR with various database technologies for processing very large datasets
Introduction | Relational databases | How about SAS and Stata | Finally, let's look at Hadoop and MapReduce! | Conclusions | References

Last update: 2019-12-20
Started: 2019-12-20

Readme and manuals

Help Manual

Help pageTopics
callAdhereR.callAdhereR
CMA_per_episode constructor.CMA_per_episode
CMA constructor for polypharmacy.CMA_polypharmacy
CMA_sliding_window constructor.CMA_sliding_window
CMA0 constructor.CMA0
CMA1 and CMA3 constructors.CMA1 CMA3
CMA2 and CMA4 constructors.CMA2 CMA4
CMA5 constructor.CMA5
CMA6 constructor.CMA6
CMA7 constructor.CMA7
CMA8 constructor.CMA8
CMA9 constructor.CMA9
Computation of event durations.compute_event_durations
Gap Days and Event (prescribing or dispensing) Intervals.compute.event.int.gaps
Compute Treatment Episodes.compute.treatment.episodes
Cover special periods.cover_special_periods
Example dispensing events for 16 patients.durcomp.dispensing
Example special periods for 10 patients.durcomp.hospitalisation
Example prescription events for 16 patients.durcomp.prescribing
Get the actual plotting area.get.event.plotting.area
Get the legend plotting area.get.legend.plotting.area
Get info about the plotted events.get.plotted.events
Get info about the plotted partial CMAs.get.plotted.partial.cmas
getCallerWrapperLocation.getCallerWrapperLocation
Access the actual CMA estimate from a CMA object.getCMA
Access last adherence plot info.last.plot.get.info
Map from event to plot coordinates.map.event.coords.to.plot
Example medication events records for 100 patients.med.events
Interactive exploration and CMA computation.plot_interactive_cma
Plot CMA_per_episode and CMA_sliding_window objects.plot.CMA_per_episode plot.CMA_sliding_window
Plot CMA0 objects.plot.CMA0
Plot CMA0-derived objects.plot.CMA1 plot.CMA2 plot.CMA3 plot.CMA4 plot.CMA5 plot.CMA6 plot.CMA7 plot.CMA8 plot.CMA9
Print CMA0 (and derived) objects.print.CMA0 print.CMA1 print.CMA2 print.CMA3 print.CMA4 print.CMA5 print.CMA6 print.CMA7 print.CMA8 print.CMA9 print.CMA_per_episode print.CMA_sliding_window
Prune event durations.prune_event_durations
Computation of initiation times.time_to_initiation