starsimhub / starsim

Starsim disease modeling framework
http://starsim.org
MIT License
12 stars 4 forks source link

Add native R interface and release on CRAN #523

Open roberthinch opened 3 months ago

roberthinch commented 3 months ago

Many epidemiology modellers use R instead of Python, so having Starsim easily available in R would help its uptake (especially if released in CRAN). Currently it can be accessed in R (as any Python package) using the R package reticulate, however, this take some effort and the code still looks very Python like (might scare of some R users). Adding a light R wrapper to make using Starsim in R more native would aid many R only users.

The basic idea would be to use some simple R objects (i.e .R6) to mirror the Python objects, which would despatch all the calls to the underlying Python code. In a few circumstances it will be necessary to add a few extra lines of native R code (e.g. rendering of plots). Additionally we would add some simple utility functions in R so Starsim could be used by people who don't want to deal with the objects directly.

devclinton commented 2 months ago

I wonder if we can leverage reticulate for something like this?