-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
78 lines (57 loc) · 2.06 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
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```
# campsis <img src='man/figures/logo.png' align="right" alt="" width="120" />
<!-- badges: start -->
[](https://github.com/Calvagone/campsis/actions)
[](https://app.codecov.io/gh/Calvagone/campsis)
[](https://cran.r-project.org/package=campsis)
[](https://cran.r-project.org/package=campsis)
[](https://cran.r-project.org/package=campsis)
<!-- badges: end -->
## Requirements
* R package `campsismod` must be installed beforehand
* Simulation engine must be installed too (`rxode2` or `mrgsolve`)
## Installation
Install the latest stable release using `devtools`:
```{r, eval=FALSE}
devtools::install_github("Calvagone/campsis")
```
## Basic example
Import the `campsis` package:
```{r, message=F, warning=F}
library(campsis)
```
Create your dataset:
```{r}
ds <- Dataset(50) %>%
add(Bolus(time=0, amount=1000, ii=12, addl=2)) %>%
add(Observations(times=seq(0, 36, by=0.5)))
```
Load your own model or use a built-in model from the library:
```{r}
model <- model_suite$pk$`2cpt_fo`
```
Simulate your results with your preferred simulation engine (`rxode2` or `mrgsolve`):
```{r, message=F}
results <- model %>% simulate(dataset=ds, dest="rxode2", seed=1)
```
Plot your results:
```{r readme_plot, fig.show='hide'}
shadedPlot(results, "CONC")
```
```{r, eval=FALSE, echo=FALSE, results='hide'}
file_vignette <- "vignettes/resources/readme_plot.png"
ggplot2::ggsave(filename=file_vignette, width=8, height=4, dpi=100)
```
```{r, eval=FALSE, echo=FALSE, results='hide'}
file.copy(file_vignette, "docs/articles/resources/")
```
