-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
122 lines (95 loc) · 4.08 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = TRUE,
warning = FALSE,
message = FALSE
)
```
# epishiny
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
__Please note this package is in alpha stage of development and not yet suitable for use in production as the API is likely to change.__
## Motivation
Interactive web-based data visualisations and dashboards are an increasingly common method
of monitoring infectious disease outbreaks. Whilst R is now a commonly used tool for analysis
and data visualisation in epidemiology, epidemiologists will often lack the knowledge required
to be able to produce interactive dashboards directly from within their R workflows,
resulting in external propriatory software being used instead.
`epishiny` aims to bridge this gap by providing simple functions that produce engaging,
feature-rich interactive visualisations and dashboards from epidemiological data
using R's [`shiny`](https://shiny.posit.co/) web-framework.
## Installation
You can install the development version of epishiny from GitHub with either the [pak](https://pak.r-lib.org/) or [remotes](https://remotes.r-lib.org/) package:
``` r
# install.packages("pak")
pak::pkg_install("epicentre-msf/epishiny", dependencies = TRUE)
# install.packages("remotes")
remotes::install_github("epicentre-msf/epishiny", dependencies = TRUE)
```
```{r include=FALSE}
# set to TRUE to take new app screenshots
update_imgs <- FALSE
```
## Demo Dashboard
Launch a demo dashboard with examples of every epishiny module with the `launch_demo_dashboard()` function.
The code for this dashboard can be found in [inst/examples/demo](https://github.com/epicentre-msf/epishiny/tree/main/inst/examples/demo)
of the package repository.
```{r include=FALSE}
if (update_imgs) {
require("shinytest2")
pkgload::load_all()
app_path <- here::here("inst/examples/demo")
app <- AppDriver$new(app_path, width = 1600, height = 900)
img_path <- tempfile(fileext = ".png")
app$get_screenshot(file = img_path, delay = 1)
fs::file_copy(img_path, "man/figures/dashboard.png", overwrite = TRUE)
app$stop()
}
```
```{r echo=FALSE}
knitr::include_graphics("man/figures/dashboard.png")
```
## Tutorials
See the articles below on the package website to get started using `epishiny` with your data.
* [Getting started](https://epicentre-msf.github.io/epishiny/articles/epishiny.html)
* Use cases
- [Linelist data](https://epicentre-msf.github.io/epishiny/articles/linelist_data.html)
- [Aggregated data](https://epicentre-msf.github.io/epishiny/articles/aggregated_data.html)
## Contributions
Contributions are welcome. See the [contributing article](https://epicentre-msf.github.io/epishiny/articles/contributing.html)
on the package website for details on how to contribute to `epishiny`.
```{r include=FALSE}
if (update_imgs) {
require("shinytest2")
# time module screenshot
app_path <- here::here("inst/examples/docs/time")
app <- AppDriver$new(app_path, width = 1000, height = 600)
img_path <- tempfile(fileext = ".png")
app$get_screenshot(file = img_path, delay = 1)
fs::file_copy(img_path, "man/figures/time.png", overwrite = TRUE)
app$stop()
# place module screenshot
app_path <- here::here("inst/examples/docs/place")
app <- AppDriver$new(app_path, width = 1000, height = 600)
img_path <- tempfile(fileext = ".png")
app$get_screenshot(file = img_path, delay = 1)
fs::file_copy(img_path, "man/figures/place.png", overwrite = TRUE)
app$stop()
# person module screenshot
app_path <- here::here("inst/examples/docs/person")
app <- AppDriver$new(app_path, width = 1000, height = 600)
img_path <- tempfile(fileext = ".png")
app$get_screenshot(file = img_path, delay = 1)
fs::file_copy(img_path, "man/figures/person.png", overwrite = TRUE)
app$stop()
}
```