R mappings for the CSDMS Basic Model Interface.
Install the development version of the BMI R mappings from GitHub:
# install.packages("remotes")
remotes::install_github("csdms/bmi-r")
If you’ve already cloned the repository locally, you can install the
mappings from R with remotes::install_local()
.
Load the mappings into an R session with:
library(bmi)
Check that the library is loaded by displaying the Bmi
R6 class:
Bmi
We recommend installing R packages into a virtual environment. At CSDMS,
we use Miniforge to set up
virtual environments with the conda
package manager.
Use conda
to create an environment called “R” with a set of packages
that are useful for developing and running R code:
conda create -n R -c conda-forge r-base r-essentials r-devtools
Activate the environment, then follow the directions above to install the BMI R mappings into the environment.
A complete sample implementation is given in the https://github.com/csdms/bmi-example-r repository.
The original form of the BMI R mappings were created by Stefan Verhoeven at the Netherlands eScience Center. See his version at https://github.com/eWaterCycle/bmi-r. The CSDMS version of the BMI R mappings grew out of his work.
This work is supported by the U.S. National Science Foundation under Award No. 2104102, Collaborative Research: Frameworks: OpenEarthscape – Transformative Cyberinfrastructure for Modeling and Simulation in the Earth-Surface Science Communities.