Skip to content

nanhung/MCSim_under_R

Repository files navigation

MCSim under R

This MCSim sandbox aim to help the beginner (especially Windows user) run GNU MCSim (current version 6.1.0) in R.

Prerequisites

Instruction

(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.

  • Note: Use 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.

Workflow

The workflow of MCSim under R can separate into three levels as following diagram,

Functions

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").

Help

Reference

About

The toolbox to run GNU MCsim under R(Studio)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages