Moves the dependency on the rsvg
package from being required to suggested, as apparently it is not available on all platforms; now, if rsvg
is not available, exporting the plot falls back on the base R plotting system.
this release splits the old AdhereR
package into two packages: AdhereR
, which continues to implement all the computations and plotting, and AdhereRViz
, which implements all the interactive plotting and GUI (using either RStudio’s manipulate and Shiny); while AdhereRViz
requires AdhereR
, AdhereR
can very well function without AdhereRViz
.
the plotting can be done either using R plotting and/or by generating SVG images (which can be further exported to different formats, such as JPG and PNG and can be embedded in HTML/CSS/JavaScript pages with limited interactivity); the plotting code was completely re-written and optimised.
new subtype of plot where the events are shown on the same row (i.e., without vertical separation): useful for cases where not many events overlap in time and vertical space is at a premium.
many other enhancements and bugfixes.
major improvements to compute_event_durations
, with a complete makeover of the handling for special periods like hospitalization and restructuring of the output.
New function prune_event_durations
to remove leftover supply from previous dispensing events in case of new dispensing events within a user-specified time after dosage changes, special periods, or treatment interruptions.
New function cover_special_periods
to identify special periods that are in proximity to already covered durations and add an additional event for these durations.
New option treat.epi
in function CMA_per_episode
to specify precomputed treatment episodes for the computation of CMA per episode.
New vignette Data preparation for computing adherence to medication in AdhereR added to explain the functions compute_event_durations
, prune_event_durations
, cover_special_periods
, and time_to_initiation
.
compute_event_durations
fixed a few instances where colnames were hardcoded to colnames in example dataset
throw errors when disp.date, presc.date, total.dose, or presc.daily.dose contain NAs
fix error when visit.colname is not in presc.data
fix progress bar when ID’s are not sequentially starting from 1
Shiny App: don’t show print and plot dose UI for CMA1-CMA4 (these don’t care about dose)
Shiny App: refactor it so it can be started independently from outside the package (allowing it, for example, to be hosted on https://www.shinyapps.io/)
plotting CMA1+ and complex: fix crash when no treatment column was defined but there was a dose column
major improvements to the interactive Shiny plotting, now a fully self-contained point-and-click user interface/App for plotting and estimating CMA from a variety of data sources
new vignette AdhereR: Interactive plotting (and more) with Shiny added for explaining the new Shiny App
now can plot dose as text and/or line width
show a warning if the user calls CMA functions with arguments that are ignored by that particular CMA (useful to make the user aware that, for example, carry-over will not be considered by CMA1
and then wonder why asking for it didn’t change anything)
various plotting improvements (axis lables, vertical lines, legend customisation, font sizes, customisable OW transparency, better computation of minimum size requirements)
plot.CMA0
ignored grascale plotting for OW and FUW
legend now is resized depending on the various legend font sizes and not on the global font sized
better handling of font sizes of 0 (now forced transparently to 0.01)
better handling of 0% for the CMA estimate plot for CMA1+, per episode and sliding windows
small bugs fixed in compute_event_durations()
better handling of messages, warnings and error during plotting
uniformisation of plotting between all types of CMA
error when passing a data.table
to interactive plotting;
in plot.CMA0
, align.all.patients=TRUE
didn’t work anymore (regression);
time_to_initiation()
was not exported;
the examples for time_to_initiation()
and compute_event_durations()
were wrongly formatted.
removed margins when plotting CMA0 (they could become too large when plotting many patients);
now allows the custom placement of legend when plotting CMA0;
the plots for CMA0-9 can now also show the daily dose as text and/or line thickness.
AdhereR
to use databasesAdhereR
can access data (read and write) stored in various types of databases, ranging from “classic” relational databases (such as MySQL
and SQLite
) to new approaches (such as Apache’s Hadoop
). This allows the seamless processing of very large datasets across many types of architectures, ranging from a consumer-grade laptop to large heterogeneous computer clusers, without loading the dataset in memory. Even interactive plotting is now capable of accessing data stored using various engines in real-time by allowing the user to define accessor functions that implement the details of this access (e.g., use SQL
queries for accessing data stored in a classic relational database).
A new vignette (Using AdhereR with various database technologies for processing very large datasets) gives all the needed details, including actual code, for running AdhereR
on relational databases (using either explicit SQL
or implicitely through dbplyr
) and on Apache Hadoop
(using RHadoop
for access to HDFS and MapReduce). (Please note that this vignette is pre-compiled due to its requirements in terms of thrid-party software such as MySQL
and Apache Hadoop
.)
Computation of CMAs requires a supply duration for medications dispensed to patients. If medications are not supplied for fixed durations but as a quantity that may last for various durations based on the prescribed dose, the supply duration has to be calculated based on dispensed and prescribed doses. Treatments may be interrupted and resumed at later times, for which existing supplies may or may not be taken into account. Patients may be hospitalized or incarcerated, and may not use their own supplies during these periods. The new function compute_event_durations
calculates the supply durations, taking into account the aforementioned situations and offering parameters for flexible adjustments.
The period between the first prescription event and the first dose administration may impact health outcomes differently than omitting doses once on treatment or interrupting medication for longer periods of time. Primary non-adherence (not acquiring the first prescription) or delayed initiation may have a negative impact on health outcomes. The new function time_to_initiation
calculates the time between the first prescription and the first dispensing event, taking into account multiple variables to differentiate between treatments.
overall optimisation of the workhorse functioncompute.event.int.gaps()
, resulting in sizeable speed-ups in some scenarios;
replacing the direct use of snow
by parallel
, dropping thus this explicit dependency;
initial introduction of unit testing (testthat
; currently not on CRAN but only during development);
distributing computations across multiple computers over a network;
small bug fixes in plotting and cma computation.
While the original interactive plotting using RStudio
’s manipulate()
function was useful, it had several limitations (dependence on RStudio
, interface design, etc.), prompting a massive rewritting of the interactive plotting system using Shiny
. The old manipulate()
method is still available, but the new one based on Shiny
offers multiple advantages, such as running in any modern web browser and even on a remote machine.
AdhereR
from outside R
(e.g., from Python 3
)AdhereR
is now tansparently callable from other programs/platforms than R
using a very simple, transparent and portable mechanism. To illustrate the full process, we implemented a fully functional reference implementation
allowing AdhereR
to be transparently used from Python 3
, implementation consisting of a Python
module adherer
included with the AhdereR
package (thus it does not need separate installation through pip
or similar mechanisms) that automatically detects where R
is installed and exposes a class hierarchy that can be used in Python
scripts or programs. Full details are available in the new calling-AdhereR-from-python3
vignette.
This is the initial release. Please see ReadMe.md and the accompanying paper for details: