Skip to content

Commit 5f67ca2

Browse files
MJC598ddbaptiste
andauthored
[Feature] Update template for templates, quarto defaults, and README (#6)
* Updating the README and _quarto doc for new information * Adding github templates * comment from respond PR about PR templates * Update README.md Co-authored-by: Dimitri Baptiste <55843498+ddbaptiste@users.noreply.github.com> * addressing PR comments --------- Co-authored-by: Dimitri Baptiste <55843498+ddbaptiste@users.noreply.github.com>
1 parent e3d6499 commit 5f67ca2

File tree

6 files changed

+106
-8
lines changed

6 files changed

+106
-8
lines changed

.Rbuildignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. See error
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Screenshots**
25+
If applicable, add screenshots to help explain your problem.
26+
27+
**Desktop (please complete the following information):**
28+
29+
- OS: [e.g. iOS]
30+
- Browser [e.g. chrome, safari]
31+
- Version [e.g. 22]
32+
33+
**Additional context**
34+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Pull Request to Default
3+
about: Submit code to be merged into the default branch
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
## What does this PR do?
10+
11+
## What Wrike task is this associated with?
12+
13+
## Checklist before merging
14+
15+
- [ ] If adding a core feature, I've added related tests.
16+
- [ ] This is part of a [product update](https://www.chameleon.io/blog/product-updates), and I've added an explanation of what is different to the changelog.

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,38 @@ A template repository for R analysis projects.
44

55
## Structure
66

7-
Data Folder - Stores all data. Should generally contain data used within the project. Ensure if it is too big that it does not get checked into VC itself but instead a reference to the data is copied.
7+
This template contains a basic analysis R project folder structure. It assumes we make use of [Quarto notebooks](https://quarto.org/) and the [renv](https://rstudio.github.io/renv/) virtual environment tool. We also make use of our custom linter and format restrictions based on our lab style guide rules.
88

9-
Notebooks - Where the analysis happens. Should be written in an Rmd format and knit together into a readable format.
9+
**Note:** While based on tidyverse, we do not subscribe to all the ideas and provide different checks. Check the [lab style guide](https://github.com/SyndemicsLab/styleguide/blob/main/Rguide.md) for more information.
1010

11-
Output - The resulting visualizations from the analysis that we want to output from the repository.
11+
### Folders
1212

13-
R - Where general R functions live. NOTE: No scripts go here, any scripting should be within the notebooks themselves alongside documentation. This is exclusively for R functions!
13+
- `data/` - General folder for all data. Ensure if it is [too big](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github#file-size-limits) that it does not get checked into version control itself but instead a reference to the data is copied.
14+
- `data/processed/` - Folder used to store data that is processed by the repository. This is not necessarily output data we want to report but intermediate data that we keep to save compute time.
15+
- `data/raw/` - Folder used to store data that has been untouched by the repository. It is a location for database routing, CSVs, etc. that are pulled from outside sources. Specifically, we do not store any data we have manipulated in this folder.
16+
- `notebooks/` - This folder contains all the Quarto notebooks and is where the analysis happens. Note, these are just `.qmd` files and not rendered results nor partially-rendered files.
17+
- `R/` - Folder used to house all R functions and scripts used across the analysis notebooks. These scripts are not meant to stand alone and should not be run outside of the analysis notebooks. If these are run outside the analysis notebooks, the function should be moved into a package structure or the script should be converted into a notebook.
18+
- `renv/` - A folder created and maintained by `renv`. Do not change by hand.
19+
- `output/` - The folder to store all results from analysis. Specifically, we want to store any generated images or data necessary for a report out. This is also where the rendering should produce the final notebooks.
20+
21+
### Files
22+
23+
- `_quarto.yml` - A yaml file that governs the entire project for quarto rendering. Specifically, this file tells the quarto command how to execute and provides basic formatting/metadata requirements for all notebooks to conform to.
24+
- `.gitignore` - A standard git file to ensure certain elements of the repository are not checked into version control.
25+
- `.lintr` - The linter file used to ensure we are linting for Syndemics specific style guide standards. It is used with the [`lintr` library](https://lintr.r-lib.org/index.html).
26+
- `.Rprofile` - A file created and maintained by `renv`. Do not change by hand. **Note:** This file sources the `utils.R` file for the helper function `ensure_packages`. This is a replacement for the `library()` and `require()` function calls.
27+
- `air.toml` - A TOML file to ensure we are providing the correct formatting to the repository. It works with the [Air formatter](https://posit-dev.github.io/air/).
28+
- `LICENSE.md` - The GNU Affero GPL. This is our lab wide standard open source License.
29+
- `PROJECT_NAME.Rproj` - The default file for RStudio projects. We recommend changing this name after creating your template.
30+
- `README.md` - This file! The basic outline of the project and explanation of the use cases.
31+
- `renv.lock` - A file created and maintained by `renv`. Do not change by hand.
32+
33+
## How to Use
34+
35+
1. Click the green button in the top right of this repository that says "Use this template" and "Create a new repository".
36+
2. Choose your name and settings for the new repository.
37+
3. Clone the new repository and rename the `PROJECT_NAME.Rproj` file.
38+
4. Run `renv::restore()` to get all libraries from `renv` installed.
39+
1. (Optional) If you want to reset the default `renv` installs run `renv::snapshot()` instead to store your libraries into the `renv`.
40+
5. Update the README to contain details about your project.
41+
6. Develop and enjoy.

_quarto.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ project:
22
output-dir: output
33

44
number-sections: true
5+
bibliography: references.bib
6+
link-citations: true
7+
execute:
8+
freeze: auto
59

610
format:
711
html: default
812
pdf:
9-
documentclass: report
1013
margin-left: 20mm
1114
margin-top: 30mm
1215
margin-right: 20mm

0 commit comments

Comments
 (0)