forked from nlmixrdevelopment/RxODE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
110 lines (84 loc) · 4.17 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!--
---
output: github_document
---
-->
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- https://blog.r-hub.io/2019/12/03/readmes/ -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# RxODE
<!-- badges: start -->
[![Build Status](https://travis-ci.org/nlmixrdevelopment/RxODE.svg?branch=master)](https://travis-ci.org/nlmixrdevelopment/RxODE)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/8vv1e3hncve9tnva?svg=true)](https://ci.appveyor.com/project/mattfidler/rxode)
[![codecov.io](https://codecov.io/github/nlmixrdevelopment/RxODE/coverage.svg)](https://codecov.io/github/nlmixrdevelopment/RxODE?branch=master)
[![CRAN version](http://www.r-pkg.org/badges/version/RxODE)](https://cran.r-project.org/package=RxODE)
[![CRAN total downloads](https://cranlogs.r-pkg.org/badges/grand-total/RxODE)](https://cran.r-project.org/package=RxODE)
[![CRAN total downloads](https://cranlogs.r-pkg.org/badges/RxODE)](https://cran.r-project.org/package=RxODE)
<!-- badges: end -->
## Overview
**RxODE** is an R package for solving and simulating from ode-based
models. These models are convert the RxODE mini-language to C and
create a compiled dll for fast solving. ODE solving using RxODE has a
few key parts:
- `RxODE()` which creates the C code for fast ODE solving based on a
[simple syntax](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-syntax.html) related to Leibnitz notation.
- The event data, which can be:
- a `NONMEM` or `deSolve` [compatible data frame](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-event-types.html), or
- created with `et()` or `EventTable()` for [easy simulation of events](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-event-table.html)
- The data frame can be augmented by adding
[time-varying](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-covariates.html#time-varying-covariates)
or adding [individual covariates](file:///home/matt/src/RxODE/docs/articles/RxODE-covariates.html#individual-covariates) (`iCov=` as needed)
- `rxSolve()` which solves the system of equations using initial
conditions and parameters to make predictions
- With multiple subject data, [this may be
parallelized](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-speed.html).
- With single subject the [output data frame is adaptive](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-data-frame.html)
- Covariances and other metrics of uncertanty can be used to
[simulate while solving](https://nlmixrdevelopment.github.io/RxODE/articles/RxODE-sim-var.html)
## Installation
You can install the released version of RxODE from
[CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("RxODE")
```
To run RxODE, you need a working c compiler. To use parallel threaded
solving in RxODE, this c compiler needs to support open-mp.
You can check to see if R has working c-compile you can check with:
```r
pkgbuild::has_build_tools(debug = TRUE)
```
If you do not have the toolchain, you can set it up as described by
the platform information below:
### Windows
In windows you may simply use installr to install rtools:
```r
install.packages("installr")
library(installr)
install.rtools()
```
### Mac OSX
Installation on a mac is much similar to RxODE installation under
windows. To enable open mp on R and RxODE, you will need to install
the gfortran and clang compilers located at
https://cran.r-project.org/bin/macosx/tools/
### Linux
To install on linux make sure you install gcc (with openmp support)
and gfortran using your distribution's package manager.
## Development Version
Since the development version of RxODE uses StanHeaders, you will need
to make sure your compiler is setup to support C++14, as described in
the [rstan setup page](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#configuration-of-the-c-toolchain)
Once the C++ toolchain is setup appropriately, you can install the
development version from
[GitHub](https://github.com/nlmixrdevelopment/RxODE) with:
``` r
# install.packages("devtools")
devtools::install_github("nlmixrdevelopment/RxODE")
```