-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03-methods.qmd
More file actions
43 lines (33 loc) · 3.78 KB
/
03-methods.qmd
File metadata and controls
43 lines (33 loc) · 3.78 KB
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
# Methods
<br>
This section describes the tools and methods used to create and utilize this template.
This template itself is the "method". It prescribes a specific way to organize and execute a reproducible research project.
## Core Technologies
1. [**Quarto:**]((https://quarto.org)) The primary authoring tool. It uses Markdown syntax for text and integrates executable code chunks (primarily R, but also Python, Julia, etc.). Key features used:
- **Book Format:** Organizes the article into chapters/sections.
- **Code Chunks:** Embed R code directly (`{r}`) for analysis and visualization.
- **Citations:** Managed via `references.bib` (BibTeX) and formatted using `apa7ed.csl`. You can use [Zotero](https://www.zotero.org/) in RStudio for this.
- **Embedding Outputs:** Results from scripts in `Scripts/` can be embedded into the narrative using `{{< embed >}}` (see Results section).
2. [**R & RStudio:**](https://posit.co/download/rstudio-desktop/) The computational engine and integrated development environment (IDE). R/RStudio is used for statistical analysis, data manipulation, and creating visualizations within Quarto documents.
3. **Git & GitHub:**
- [**Git:**](https://git-scm.com/) Provides version control locally. Every significant change to your project files is tracked.
- [**GitHub:**](https://github.com/) Hosts the repository online, enabling collaboration, sharing, backup, and to publish the dynamic document (Github Pages). It also integrates with GitHub Actions.
4. **Environment Management:**
- [**renv:**](https://rstudio.github.io/renv/) (Proper Reproducibility) Tracks and restores specific R package versions used in the project. The `renv.lock` file is the key component.
- [**Docker:**](https://www.docker.com/) (Full Reproducibility) Packages the entire software environment (R, RStudio, Quarto, packages, LaTeX) into a container. This guarantees that the environment is identical for anyone running the project. The `docker/` folder contains the necessary configuration (`Dockerfile`, `docker-compose.yml`, `start/stop` scripts).
- [**MyBinder**](https://mybinder.org/): Cloud platform for reproducibility verification. Provides one-click browser-based access to a complete computational environment, enabling verification without local installation (`.binder/Dockerfile`)
5. **Sharing & Publication:**
- [**OSF:**](https://osf.io/) A platform for registering, storing, and sharing research materials openly.
- [**GitHub Pages:**](https://pages.github.com/) A free service to host the rendered HTML version of your Quarto book/article directly from your GitHub repository. The `.github/workflows/deploy.yml` file automates this process.
## Workflow Integration
If you need to learn a little more about Reproducible Research with [R/RStudio](https://posit.co/download/rstudio-desktop/), there are excellent free e-books:
- [R for Data Science](https://r4ds.hadley.nz/)
- [Building reproducible analytical pipelines with R](https://raps-with-r.dev/)
- [The Open Science Manual: Make Your Scientific Research Accessible and Reproducible](https://arca-dpss.github.io/manual-open-science/)
The typical workflow using this template for Full Reproducibility involves:
1. Setting up the environment using Docker (`docker/start.sh` or `start.bat`).
2. Working within the RStudio container to edit `.qmd` files, run code chunks, and manage R packages (tracked by `renv`).
3. Rendering the document using `quarto render` in the RStudio Terminal.
4. Stopping the Docker environment when done (`docker/stop.sh` or `stop.bat`).
5. Using Git locally to commit and push changes to your GitHub repository.
6. Optionally, pushing to the `main` branch triggers the GitHub Actions workflow to automatically publish the updated HTML site to GitHub Pages.