You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,38 @@ A template repository for R analysis projects.
4
4
5
5
## Structure
6
6
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.
8
8
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.
10
10
11
-
Output - The resulting visualizations from the analysis that we want to output from the repository.
11
+
### Folders
12
12
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.
0 commit comments