-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME.Rmd
138 lines (111 loc) · 7.5 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "docs/figs/"
)
```
[](https://zenodo.org/badge/latestdoi/197059951)
# darthpack <img src='man/figures/logo.png' align="right" height="139" />
<!-- <img src="docs/figs/under_const.jpeg" align="center" alt="" width="360" /> -->
[`darthpack`](https://github.com/DARTH-git/darthpack) is an R package that showcases the [Decision Analysis in R for Technologies in Health (DARTH)](https://darthworkgroup.com) coding framework to construct model-based cost-effectiveness analysis in R. The main website of `darthpack` can be [found here](https://darth-git.github.io/darthpack/).
[`darthpack`](https://github.com/DARTH-git/darthpack) is part of the following manuscript:
- Alarid-Escudero F, Krijkamp E, Pechlivanoglou P, Jalal H, Kao SY, Yang A, Enns EA. ["A need for change! A coding framework for improving transparency in decision modeling"](https://link.springer.com/article/10.1007%2Fs40273-019-00837-x). PharmacoEconomics 2019;37(11):1329–1339. http://dx.doi.org/10.1007/s40273-019-00837-x
The release that accompanies the published article has been archived in zenodo: https://zenodo.org/record/3445451.
To learn more on Markov/cohort state-transition model in R, we recommend reading our introductory tutorial on **time-independent** cSTMs in R:
- Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM,
Pechlivanoglou P, Jalal H. [An Introductory Tutorial on Cohort
State-Transition Models in R Using a Cost-Effectiveness Analysis
Example](https://journals.sagepub.com/doi/full/10.1177/0272989X221103163).
[Medical Decision Making](https://journals.sagepub.com/home/mdm),
2023;43(1):3-20. <https://doi.org/10.1177/0272989X221103163>,
our intermediate tutorial on **time-dependent** cohort state-transition models (cSTMs) in R:
- Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM,
Pechlivanoglou P, Jalal H. [A Tutorial on Time-Dependent Cohort
State-Transition Models in R using a Cost-Effectiveness Analysis
Example](https://journals.sagepub.com/doi/full/10.1177/0272989X221121747).
[Medical Decision Making](https://journals.sagepub.com/home/mdm).
2023;43(1):21-41. <https://doi.org/10.1177/0272989X221121747>,
and understanding the use of multidimensional arrays to represent cSTM
dynamics in R described in:
- Krijkamp EM, Alarid-Escudero F, Enns EA, Pechlivanoglou P, Hunink MGM,
Yang A, Jalal HJ. [A multidimensional array representation of
state-transition model
dynamics](https://journals.sagepub.com/doi/full/10.1177/0272989X19893973).
[Medical Decision Making](https://journals.sagepub.com/home/mdm),
2020;40(2):242-248. <https://doi.org/10.1177/0272989X19893973>
# Preliminaries
- Install [RStudio](https://www.rstudio.com/products/rstudio/download/)
- Install `devtools` to install `darthpack` as a package and modify it to generate your own package
```{r, eval=FALSE}
# Install release version from CRAN
install.packages("devtools")
# Or install development version from GitHub
# devtools::install_github("r-lib/devtools")
```
- Install `pkgdown` to publish `darthpack` or your own `darthpack`-based repository or package as a website (optional)
```{r, eval=FALSE}
# Install release version from CRAN
install.packages("pkgdown")
# Or install development version from GitHub
# devtools::install_github("r-lib/pkgdown")
```
# Usage and installation
`darthpack` repository could be used in at least three different ways:
1. [GitHub coding template](#use-repository-as-a-github-coding-template) for using it to generate a repository of your own model-based decision or cost-effectiveness analysis linked to the original `darthpack` GitHub repository
2. [Regular coding template](#use-repository-as-a-regular-coding-template) for using it to generate a repository of your own model-based decision or cost-effectiveness analysis
3. [R package](#use-as-an-r-package) for using it as a standalone package to run current functions of `darthpack`
The main website of the package could be found in: https://darth-git.github.io/darthpack/
## Use repository as a GitHub coding template
1. Sign in to GitHub. You need to sign in to use this repository as a template. If you don’t have a GitHub account, you can [create one here](https://github.com/join).
2. On the `darthpack` GitHub repository, navigate to the main page of the repository (https://github.com/DARTH-git/darthpack).
3. Above the file list, click **Use this template**.
4. Use the **Owner** drop-down menu, and select the account you want to own the repository.
5. Type a name for your repository of your decision model, and an optional description.
6. Choose to make the repository either public or private. Public repositories are visible to the public, while private repositories are only accessible to you, and people you share them with. For more information, see "[Setting repository visibility](https://help.github.com/en/articles/setting-repository-visibility)."
7. Click **Create repository from template**.
8. Either clone the repository or download it.
a. **Clone**, which requires the user to have a GitHub desktop installed, or
b. **Download zip** that will ask the user to download the whole repository as a .zip file.
9. Open the RStudio project `darthpack.Rproj`.
10. Install all the required and suggested packages listed in the [*DESCRIPTION*](https://github.com/DARTH-git/darthpack/blob/master/DESCRIPTION) file in the main folder of the repository
- To install `dampack`, please follow these instructions:
```{r, eval=FALSE}
# Install development version from GitHub
devtools::install_github("DARTH-git/dampack")
```
11. In RStudio, load all the functions and data from the repository by typing `devtools::load_all(".")`
12. Run all the decision modeling modules in the analysis folder.
## Use repository as a regular coding template
1. On the `darthpack` GitHub repository, navigate to the main page of the repository (https://github.com/DARTH-git/darthpack).
2. Above the file list, click **Clone or download** and select either
a. **Open in desktop**, which requires the user to have a GitHub desktop installed, or
b. **Download zip** that will ask the user to download the whole repository as a .zip file.
3. Open the RStudio project `darthpack.Rproj`.
4. Install all the required and suggested packages listed in the [*DESCRIPTION*](https://github.com/DARTH-git/darthpack/blob/master/DESCRIPTION) file in the main folder of the repository
- To install `dampack`, please follow these instructions:
```{r, eval=FALSE}
# Install development version from GitHub
devtools::install_github("DARTH-git/dampack")
```
5. In RStudio, load all the functions and data from the repository by typing `devtools::load_all(".")`
6. Run all the decision modeling modules in the analysis folder.
## Use as an R package
1. Install the development version of `darthpack` from [GitHub](https://github.com) with:
```{r, eval=FALSE}
devtools::install_github("DARTH-git/darthpack")
```
2. Load all the functions and data from the repository by typing
```{r, eval=FALSE}
library(darthpack)
```
# Release your updated framework
Once the framework has been modified and updated to your specific needs, run `pkgdown` from the package directory each time you release your package:
```{r, eval=FALSE}
pkgdown::build_site()
```
For a more detailed description on how to quickly and easily build a website for your package, please go to https://github.com/r-lib/pkgdown and