Skip to content

Commit b54c93a

Browse files
committed
update readme
1 parent be310a7 commit b54c93a

File tree

1 file changed

+63
-10
lines changed

1 file changed

+63
-10
lines changed

README.md

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,85 @@
1-
## Developing a reproducible Shiny app
1+
# Developing a reproducible Shiny app
22

3-
Example Shiny application adopting the recommendations of "10 Quick Tips for Developing a Reproducible Shiny Application", Brun et al, 2025, PLOS Computational Biology.
3+
Example Shiny application adopting the recommendations of "Ten Quick Tips for Developing a Reproducible Shiny Application", Brun et al, 2025, PLOS Computational Biology.
44

55
In this example, we are reusing the Faithful Shiny app example (<https://shiny.posit.co/r/gallery/start-simple/faithful/>) provided as part of the R `shiny` package. This Shiny application displays eruption data for the Old Faithful geyser.
66

7-
Tips demonstrated:
7+
## Tips demonstrated:
88

99
- Set up your computing environment
1010
- Use git and GitHub
1111
- Use `renv` to record package versions
1212
- Record the output of `sessionInfo()`
1313
- Document and develop incrementally
1414
- Comment UI elements
15-
- Make your Shiny application portable and easy to maintain
15+
- Make your Shiny application modualr and portable
1616
- Organize code and data
1717
- Use relative paths and `file.path`
1818
- Preprocess and cache data for performance
19-
- Cache processed data in a local file
19+
- Cache remotely-accessed and processed data in a local file
2020
- Make underlying data accessible
2121
- Cite the original data
2222
- License code and data appropriately
2323
- Add a LICENSE file
2424
- Respect the license of the original data
25-
- Make you data and source code citable
26-
- Add README and CITATION.cff files
27-
- Publish your app
25+
- Make your data and source code citable
26+
- Add a suggested citation to the README
27+
- Add a CITATION.cff file
28+
- Share your app
2829
- Publish on shinyapps.io and archive in Zenodo
30+
31+
## How to run this Shiny app
2932

30-
The underlying data is available as part of R package X. The original source is...
33+
1. Clone this repository and run at the R console: `shiny::runApp()`
34+
2. At the R console run: `shiny::runGitHub(repo="shiny-qt-example", "UCSB-Library-Research-Data-Services")`
3135

32-
Cite this work as: Brun, J., Janée, G., & Curty, R. G. (2025). Example Shiny application adopting the recommendations from "10 Quick Tips for Developing a Reproducible Shiny Application" [Computer software]. <https://github.com/UCSB-Library-Research-Data-Services/shiny-qt-examples>
36+
## File structure
37+
38+
This repository has the following file structure:
39+
40+
```bash
41+
├── CITATION.cff
42+
├── data
43+
│   ├── faithful_data.csv
44+
│   └── metadata.md
45+
├── global.R
46+
├── LICENSE
47+
├── README.md
48+
├── renv
49+
│   ├── activate.R
50+
│   ├── library
51+
│   ├── settings.json
52+
│   └── staging
53+
├── renv.lock
54+
├── server.R
55+
├── sessionInfo.txt
56+
├── shiny-qt-example.Rproj
57+
└── ui.R
58+
```
59+
60+
### Shiny app
61+
62+
- `global.R`: Load libraries and check for existing data files
63+
- `server.R`: server side functions of the Shiny app used to compute the histogram plot and other plot features
64+
- `ui.R`: user interface of the Shiny app
65+
66+
### Virtual computing environment
67+
68+
This app uses `renv` to create a virtual environment
69+
70+
- `renv.lock`: list of the R packages used by the virtual environment
71+
- `.Rprofile`: ensures that the library is used every time you open that project
72+
- `renv/activate.R`: R script sourced by .Rprofile to activate the virtual environment
73+
- `renv/settings.json`: virtual environment settings
74+
75+
### Data
76+
77+
- `faithful_data.csv`: CSV file version of the faithful data from the datasets R package
78+
- `metadata.md`: metadata information about faithful_data.csv
79+
80+
## References
81+
82+
The underlying data is available as part of R package datasets. The version used is distributed with R 4.5.0. This version is a simplified
83+
of the original data collected by Azzalini, A. and Bowman, A. W. (1990). See metadata.md in the `data` directory for more information.
84+
85+
Cite this work as: Brun, J., Janée, G., & Curty, R. G. (2025). Example Shiny application adopting the recommendations from "Ten Quick Tips for Developing a Reproducible Shiny Application" [Computer software]. <https://github.com/UCSB-Library-Research-Data-Services/shiny-qt-examples>

0 commit comments

Comments
 (0)