iiasa / iiasa/message-ix-models
Integrate R scripts
- Dominant language
- Python
- Stars
- 32
- Forks
- 57
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 5
Description
`message_data` contains some modules that are partly or entirely in R. For instance:
- The DLE code is entirely in R.
- The Nexus (water) code is partly in Python, but with data processing scripts in R.
This issue is to **discuss approaches** so that this code (a) can be integrated into complete workflows that run unsupervised, and (b) can be more reusable, in a standard way. The implementation should be in message-ix-models.
Some ideas:
1. Provide a CLI command like `mix-models r-script foo/bar/baz` that will simply invoke a file at (e.g.) `message_data/foo/bar/baz.R`, while providing some standard environment variables that the script can use to understand paths to data, etc.
2. Use [`rpy2`](https://rpy2.github.io/doc/v3.4.x/html/introduction.html) (with documentation & demo code) in Python code to directly call functions from R code in particular files, and retrieve its output for further processing.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing DLE and Nexus code in message_data, including the R data-processing scripts, and inspect pull request #58. Compare the proposed CLI invocation with the rpy2 approach against the goals of unsupervised workflows and reusable standard integration; done requires a decided approach and its implementation in message-ix-models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, r
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100