-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathReadme.Rmd
67 lines (49 loc) · 2.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
---
title: "2021 QBios Workshop - Building interactive dashboards"
output:
github_document:
html_preview: false
author:
- Aroon T. Chande
- Lavanya Rishishwar
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Getting started
To get started, clone this repository in the command line or download the ZIP file and open the **`GaTech-QBiosWorkshop-20210518.Rproj`** file with RStudio
```{bash get-files, eval = F}
# clone the repo
git clone [email protected]:appliedbinf/2021-QBiosWorkshop.git
cd 2021-QBiosWorkshop
```
We will also be using RStudio Connect and the [ShinyApps.io](https://www.shinyapps.io/ "shinyapps.io") platform. Please make a free account before the session. You will need your [token](https://www.shinyapps.io/admin/#/tokens) to link RStudio with the ShinyApps.io platform.
## Setting up your environment
### Installing the R dependencies
There are a number of R packages that we will need today to build our dashboards. Please run the below code in your Rstudio console window.
```{r install-deps, eval = F}
packages <- c("shiny", "deSolve")
install.packages(packages)
```
### Linking ShinyApps
To link your [ShinyApps.io](https://www.shinyapps.io/ "shinyapps.io") profile with RStudio, visit your [tokens](https://www.shinyapps.io/admin/#/tokens) page and run the provided code snippet (example below) in your RStudio console.
```{r example-shinyapps-token, eval = F}
rsconnect::setAccountInfo(name = 'appliedbinf',
token = 'alongtokenstringhere',
secret = 'supersecretsecretstringhere')
```
## Example code
We've provided a series of Shiny code samples in the **`examples`** folder:
```{bash samples, eval = F}
examples/
├── 00_HelloWorld.R
├── 01_HelloSliders.R
├── 02_HelloPlots.R
├── 03_HelloInteractions.R
├── 04_MoreInteractions.R
├── 05_OrganizingUI.R
├── 06_HelloNavbar.R
├── 07_NavBarApp.R
└── 08_SIRModel.R
```
As the file numbers increase, so does the complexity of the application. **`00_HelloWorld.R`** is the simplest Shiny application and prints a simple "Hello World!" example. **`08_SIRModel.R`** is a full fledged SIRD application, but not much has been done to make it pretty or user friendly.