This MCSim sandbox aim to help the beginner (especially Windows user) run GNU MCSim (current version 6.1.0) in R.
(1) Download all files from this repository or HERE.
(2) Open "MCSim_under_R.Rproj"
.
(3) Open the R script in examples folder and follow the guidance to do the simple test run.
getwd()
in R to make sure your working directory is in MCSim_under_R
, such as C:/Users/nanhung/MCSim_under_R
. The default install location of Rtools is c:/Rtools
. The workflow of MCSim under R can separate into three levels as following diagram,
Here are the R functions that can help you run MCSim in R environment more easily. All R functions are put in functions.R
in MCSim folder.
makemcsim(model, deSolve)
: Preprocessing and compiling the model-file to the executable file as makemcsim in GNU MCSim. The model
assignment is a string giving the name of the model-file (e.g., "pbpk.model.R"
). The deSolve
assignment is a logical factor to use deSolve package as an ODE solver. mcsim(model, input)
: Using the compiled program with the input-file to run simulation. See Running Simulations. The input
assignment is a string giving the name of the input-file (e.g., "linear.in.R"
).Welcome to submit your problem in issues
For more detail, please see this tutorial slide