Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 5c1d4f9
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri Jun 24 17:39:41 2022 +0200

    As submitted to CRAN

commit fdeb7d8
Author: Dan Dediu <ddediu@gmail.com>
Date:   Sat Jun 18 20:33:35 2022 +0200

    Fix CRAN check errors and warnings

commit a6d8423
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri Jun 17 16:43:49 2022 +0200

    Solve GitHub #190 by allowing the recovery of the mapping between events and episodes/sliding windows, and even plotting it

commit 5a74ae9
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri Jun 17 12:42:44 2022 +0200

    Implement return.mapping.events.sliding.window for CMA_sliding_window

commit 7768564
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri Jun 17 11:33:07 2022 +0200

    Fix GitHub #192: now  align.first.event.at.zero is FALSE by default

commit f0f3b5d
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu Jun 16 23:39:57 2022 +0200

    The simple CMAs return .EVENT.USED.IN.CMA in event.info

commit 9b5975a
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed Jun 15 16:28:13 2022 +0200

    Fix GitHub #191 and bump version to 0.8

commit 3cac87b
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon Jun 6 16:46:45 2022 +0200

    Fix GitHub #184: Python 3 wrapper does not show anymore warnings about overriding some arguments

commit 85475b1
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon Jun 6 16:15:44 2022 +0200

    Python3 wrapper: handle plotting complex CMAs with event intervals

commit 2880088
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon Jun 6 16:14:31 2022 +0200

    Fix bug when plotting complex CMAs showing event intervals with custom column names

commit 37c25c7
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 18:13:47 2022 +0200

    Update the NEWS.md to reflect the Python 3 changes

commit 58d2b7d
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 18:11:18 2022 +0200

    Rebuild the Python3 vignette (and remove the junyper checkpoint)

commit 6c4a539
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 18:07:55 2022 +0200

    AdhereR works from Python 3 Jupyter Notebooks (and with rpy2)!

    I also update the vignette and added two notebook examples

commit bc77b21
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 15:06:44 2022 +0200

    Fix GitHub #184 and a bug with Python3 and plotting complex CMAs

commit 675d57a
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 14:05:24 2022 +0200

    Pyhton3 wrapper: handle medication groups (defined by a column in the data)

commit 17d6b22
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 31 11:29:49 2022 +0200

    Python 3 wrapper: finished updating plot() + small bug fixes

commit 8d5d13e
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon May 30 16:51:35 2022 +0200

    Python3 wrapper: add plot.partial.CMAs* to plot()

commit bac9449
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon May 30 13:43:37 2022 +0200

    Python3 wrapper: add CMA.cex to plot()

commit 9ed89d2
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon May 30 11:51:04 2022 +0200

    Python3 wrapper: add dose* to plot()

commit e641baa
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon May 30 10:52:01 2022 +0200

    Python3 wrapper: implemented medication.groups in plot()

commit a135ce3
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 27 19:31:06 2022 +0200

    Python3 wrapper: xlab, ylab & title added to plot()

commit 69e6575
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 27 12:54:08 2022 +0200

    Python3 wrapper: make col.cats in plot() work

commit be1a454
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 27 11:32:19 2022 +0200

    Fix bug: cex.title in plot() was not implemented

commit e1b5b65
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 27 11:08:08 2022 +0200

    Starting to update the Python3 wrapper to reflect the new parameters

commit c2ddb1a
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed May 25 17:05:02 2022 +0200

    Fix GitHub #182: the vignette shows how to change an AdhereR plot

commit b19e6bd
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon May 23 22:10:25 2022 +0200

    Fixes issue #181 (plotting with aligned patients) and shows how to use AdhereR with pipe

commit 05d02b4
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu May 19 19:21:46 2022 +0200

    Latest source packages AdhereR 0.7.1 and bump to AdhereRViz 0.2.1

commit 79a966f
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu May 19 19:19:16 2022 +0200

    Work-around for GitHub #156 by allowing the plotting of the legend only

commit 9e5a311
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu May 19 12:35:57 2022 +0200

    Fix #169 by forcing arguments.that.should.not.be.defined=NULL (smartly) in sliding windows and per episodes

commit 42a3a82
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu May 19 11:59:10 2022 +0200

    Shiny: make sure the event interval defaults are correctly reset on changing the CMA

commit cf985f3
Author: Dan Dediu <ddediu@gmail.com>
Date:   Thu May 19 11:51:36 2022 +0200

    Fix #179 (CMA class not correctly initialised/updated in Shiny)

commit 9348b76
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed May 18 19:19:00 2022 +0200

    Shiny UI allows plotting event intervals for sliding windows and per per episodes

    Controlled from Aesthetics -> Event intervals; default = FALSE

commit 6e28af7
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed May 18 16:22:25 2022 +0200

    AdhererViz: bump version and fix check warnings

commit e4f5d36
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed May 18 13:09:18 2022 +0200

    Fixes GitHub issue #172

commit af2443c
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed May 18 13:05:10 2022 +0200

    Per episodes can also show the event intervals and gaps

commit ae58093
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 17 14:44:20 2022 +0200

    Update documentation and fix check warnings

commit 24eb65e
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue May 17 14:27:27 2022 +0200

    Plotting events and gaps seems to work for sliding windows

commit a51e0b1
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 13 13:25:32 2022 +0200

    Plotting intervals and gaps for sliding windows seems to work (but needs testing)

commit 95facec
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 13 11:14:48 2022 +0200

    ... actually, it does make sense to compute the inner.event.info even for overlapping windows (it is the user's problem to use them or not)

commit 9426ed5
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 13 11:06:24 2022 +0200

    Don't compute the inner.event.info if the sliding windows are overlapping

commit f3ac228
Author: Dan Dediu <ddediu@gmail.com>
Date:   Fri May 13 10:22:04 2022 +0200

    Don't print inner.event.info if present for per_episode and sliding_window objects

commit f0c6a68
Author: Dan Dediu <ddediu@gmail.com>
Date:   Tue Apr 5 19:57:25 2022 +0200

    Now plot() respects the order of patients given through patients.to.plot

commit f8cfb67
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed Nov 24 17:31:12 2021 +0100

    GitHub #172 : initial plotting of inner event intervals

commit 049760a
Author: Dan Dediu <ddediu@gmail.com>
Date:   Wed Nov 24 16:56:02 2021 +0100

    Fix GitHub #175

    + some other preliminary work on plotting event intervals in sliding windows and per intervals (but nothing user-visible yet)

commit ac22abe
Author: Dan Dediu <ddediu@gmail.com>
Date:   Mon Nov 22 12:44:14 2021 +0100

    Fix GitHub #174 (plus a small bug fix when plotting as a time series with 1 point)

    Now the placeholder for partial CMAs is plotted even if they don't have one...

commit 6c9846e
Author: Dan Dediu <ddediu@gmail.com>
Date:   Sun Nov 7 23:56:53 2021 +0100

    GitHub #172

    Proof-of-concept that I can return the full event.info from sliding windows -> it adds overheads so disabled by default, but can be enabled by forcing the new argument return.inner.event.info to TRUE
  • Loading branch information
ddediu committed Jun 24, 2022
1 parent 545d615 commit 6d4955e
Show file tree
Hide file tree
Showing 42 changed files with 9,552 additions and 3,382 deletions.
17 changes: 9 additions & 8 deletions AdhereR/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: AdhereR
Type: Package
Title: Adherence to Medications
Version: 0.7.0
Version: 0.8.0
Authors@R: c(person("Dan", "Dediu", role = c("aut", "cre"),
email = "ddediu@gmail.com"),
person("Alexandra", "Dima", role = "aut",
Expand Down Expand Up @@ -33,17 +33,18 @@ LazyData: TRUE
Imports: lubridate (>= 1.5),
parallel (>= 3.0),
data.table (>= 1.9),
rsvg (>= 1.3),
jpeg (>= 0.1),
png (>= 0.1),
webp (>= 1.0),
methods
rsvg (>= 1.3),
jpeg (>= 0.1),
png (>= 0.1),
webp (>= 1.0),
methods
Depends: R (>= 3.0)
Suggests: rmarkdown (>= 1.1),
knitr (>= 1.20),
R.rsp (>= 0.40),
base64(>= 2.0),
base64 (>= 2.0),
viridisLite (>= 0.4),
AdhereRViz (>= 0.2)
VignetteBuilder: knitr, R.rsp
Encoding: UTF-8
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
5 changes: 5 additions & 0 deletions AdhereR/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ S3method(getCMA,CMA_sliding_window)
S3method(getEventInfo,CMA0)
S3method(getEventInfo,CMA_per_episode)
S3method(getEventInfo,CMA_sliding_window)
S3method(getInnerEventInfo,CMA_per_episode)
S3method(getInnerEventInfo,CMA_sliding_window)
S3method(getMGs,CMA0)
S3method(getMGs,CMA_per_episode)
S3method(getMGs,CMA_sliding_window)
Expand Down Expand Up @@ -62,6 +64,9 @@ export(get.plotted.partial.cmas)
export(getCMA)
export(getCallerWrapperLocation)
export(getEventInfo)
export(getEventsToEpisodesMapping)
export(getEventsToSlidingWindowsMapping)
export(getInnerEventInfo)
export(getMGs)
export(last.plot.get.info)
export(map.event.coords.to.plot)
Expand Down
37 changes: 37 additions & 0 deletions AdhereR/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# AdhereR 0.7.1

## New features

- now `plot()` respects the order of patients given through the `patients.to.plot` argument.

- plotting sliding windows and per episodes can now show the events and gaps (as for simple plots, but things are a bit more complicated as different windows/events might result in different estimates).

- `plot()` has an "advanced" parameter `do.not.draw.plot` which, when `TRUE`, does not draw the plot but only the legend, allowing its display separate from (or next to) the plot.

- `AdhereR` is compatible with the pipe operator (`%>%` or `|>`), the overview vignette now shows several examples.

- the overview vignette now shows an example of modifying an `AdhereR` plot *a posteriori* by adding various elements (lines, symbols and text) to a CMA plot.

- the `Python 3` wrapper (bridge) was updated, as was the associated vignette; `AdhereR` can now be used transparently from Junyper Notebooks (and even through `rpy2`) and two example notebooks have been included.

- the `event.info` table returned by the simple CMAs (`CMA1`..`CMA9`) now includes an extra column, `.EVENT.USED.IN.CMA`, which is `TRUE` if and only if the event on that row was actually used to estimate the CMA; this info can be used by itself, but is aimed at finding out which event is included in which episode or sliding window (see below).

- `CMA_per_episode` and `CMA_sliding_window` can now return the mapping between events and episodes or sliding windows, if the parameter `return.mapping.events.episodes` or `return.mapping.events.sliding.window` (respectively) is set to `TRUE`; in this case, there is an extra component of the constructed object, called `mapping.episodes.to.events` or `mapping.windows.to.events` respectively, which give, for each event or sliding window, the row number (in the data) of the event(s) that participate in it.

- plotting a `CMA_per_episode` or `CMA_sliding_window` object with a `mapping.episodes.to.events` or `mapping.windows.to.events` component, respectively, can how which events belong to which episode or sliding window visually, if the parameter `print.episode.or.sliding.window` is set to `TRUE`.

## Bug fixes

- `plot()`'s `align.all.patients` and `align.first.event.at.zero` did not work as intended.

- the unneeded columns of the `data` argument to the CMA functions are now ignored, avoiding cases where "reserved" column names might be used (moreover, there is now an explicit check against using such reserved column names).

- various other enhancements and bugfixes.

### `CMA_polypharmacy`

- remove option to supply medication class as list after `.check.medication.class` was suppressed from `AdhereR`.

- specify columns to merge by.


# AdhereR 0.7

## New features
Expand Down
1,027 changes: 832 additions & 195 deletions AdhereR/R/adherer.R

Large diffs are not rendered by default.

1,273 changes: 704 additions & 569 deletions AdhereR/R/call-adherer-external.R

Large diffs are not rendered by default.

2,896 changes: 1,544 additions & 1,352 deletions AdhereR/R/plotting.R

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions AdhereR/inst/wrappers/python3/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Python 3 wrapper and Junyper Notebook examples

This folder contains the `Python 3` module `adherer.py` that implementes the `Python 3` wrapper for `AdhereR`, as well as two examples of using `AdhereR` from `Python 3 Junypper Notebooks`.
While `jupyter_notebook_python3_wrapper.ipynb` shows the use of the Python 3 wrapper to compute and plot CMAs, `jupyter_notebook_python3_py2.ipynb` shows the same thing but using the more generic `rpy2` mechanism (which, however, results in a shlightly clunckier code).
Loading

0 comments on commit 6d4955e

Please sign in to comment.