-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
91 lines (65 loc) · 3.4 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
---
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%"
)
```
# INCLUDE Shiny Template
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
<!-- badges: end -->
Welcome to INCLUDE. This repository will serve as a guide for developing
shiny applications and contains the most basic golem shiny application
structure.
## Installation
You can install the released version of includeshinytemplate from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("includeshinytemplate")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("include-dcc/include-shiny-template")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(includeshinytemplate)
## basic example code
```
## Using this template
1. After copying this template, these are the files that must be updated with your repository name.
- README.Rmd
- docker-compose.yml
- CONTRIBUTING.md
- dev/01_start.R
- dev/02_dev.R
1. After updating these files, please make sure to run the functions in `dev/01_start.R` to update this repository.
1. If you want to push this shiny application to CAVATICA, add a github secret with your CAVATICA_AUTH_TOKEN. Make sure you also create a CAVATICA project. Comment the `deploy` section of the `.github/workflows/ci.yaml`.
## Developmental Guide
In this shiny application template we try to follow the guidelines described by Engineering Production-Grade Shiny Apps: https://engineering-shiny.org/index.html. In particular we utilize tools such as `golem` and `renv` to build our shiny application. The steps described below can all be found in more detail in the shiny engineering link above.
1. Create Golem Shiny App: `golem::create_golem()` as documented [here](https://engineering-shiny.org/setting-up-for-success.html#create-a-golem)
1. Utilize [renv](https://engineering-shiny.org/build-yourself-safety-net.html#renv) to set up your R environment
1. Update readme by modifying README.Rmd (not README.md):
```
devtools::build_readme()
```
1. Add golem modules. You will most likely want to remove `mod_hello_world.R` and add your own golem module. Be sure to add to `app_ui.R` and `app_ui.R` to use your module. More information [here](https://engineering-shiny.org/build-app-golem.html#submodules-and-utility-functions)
```
golem::add_module( name = "hello_world" )
```
1. Add tests. More information [here](https://engineering-shiny.org/build-app-golem.html#add-tests)
```
usethis::use_test( "app" )
```
1. Need to use Python? Use [reticulate](https://rstudio.github.io/reticulate/) Be sure to use either `conda` or `pipenv` to manage your Python dependencies.
1. The CI/CD for this repository is done through github actions and consists of 3 major steps. The file is located at .github/workflows/ci.yaml
* test: Testing of the shiny package
* docker: This section is commented out ci.yaml but you can choose to un-comment it out if you want to use this.
* deploy: Upload this to CAVATICA project so it can be used in data cruncher.