-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
80 lines (56 loc) · 3.24 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
---
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 = "man/figures/README-"
)
```
# `accrualPlot` <img src='man/figures/logo.png' align="right" width="200">
[![](https://www.r-pkg.org/badges/version/accrualPlot?color=green)](https://cran.r-project.org/package=accrualPlot)
`r badger::badge_custom("dev version", as.character(packageVersion("accrualPlot")), "blue", "https://github.com/CTU-Bern/accrualPlot")`
[![Actions Status](https://github.com/CTU-Bern/accrualPlot/workflows/R-CMD-check/badge.svg)](https://github.com/CTU-Bern/accrualPlot/actions)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/accrualPlot)](https://cran.r-project.org/package=accrualPlot)
<!-- ![travis](https://travis-ci.com/CTU-Bern/presize.svg?branch=master) -->
<!-- [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/CTU-Bern/presize?branch=master&svg=true)](https://ci.appveyor.com/project/CTU-Bern/presize) -->
<!-- [![codecov](https://codecov.io/github/CTU-Bern/accrualPlot/branch/master/graphs/badge.svg)](https://codecov.io/github/CTU-Bern/accrualPlot) -->
Accrual plots are an important tool when monitoring clinical trials. Some trials are terminated early due to low accrual, which is a waste of resources (including time). Assessing accrual rates can also be useful for planning analyses and estimating how long a trial needs to continue recruiting participants. `accrualPlot` provides tools for such plots
## Installation
`accrualPlot` can be installed from CRAN in the usual manner:
```{r cran-installation, eval = FALSE}
install.packages('accrualPlot')
```
The development version of the package can be installed from the CTU Bern universe via
```{r universe-installation, eval = FALSE}
install.packages('accrualPlot', repos = c('https://ctu-bern.r-universe.dev', 'https://cloud.r-project.org'))
```
`accrualPlot` can be installed directly from from github with:
```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("CTU-Bern/accrualPlot")
```
Note that `remotes` treats any warnings (e.g. that a certain package was built under a different version of R) as errors. If you see such an error, run the following line and try again:
```{r remotes-error, eval = FALSE}
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = "true")
```
## Overview
The first step to using `accrualPlot` is to create an accrual dataframe. This is simply a dataframe with a counts of participants included per day.
```{r}
# load package
library(accrualPlot)
# demonstration data
data(accrualdemo)
df <- accrual_create_df(accrualdemo$date)
```
Cumulative and absolute recruitment plots , as well as a method to predict the time point of study completion, are included.
```{r, fig.height=3, fig.width=7.5}
par(mfrow = c(1,3))
plot(df, which = "cum")
plot(df, which = "abs")
plot(df, which = "pred", target = 300)
```
### Acknowledgements
The package logo was created with [`ggplot2`](https://ggplot2.tidyverse.org/) and [`hexSticker`](https://github.com/GuangchuangYu/hexSticker) with icons from [Font Awesome](https://fontawesome.com/) (via the [emojifont package](https://github.com/GuangchuangYu/emojifont)).