Summary and Setup
This workshop explores the powerful combination of Quarto and RStudio to author scientific publications. We aim to enhance researchers’ adoption of open and reproducible practices while improving their project and data management skills. This workshop is structured into three modules. The modular format encourages instructors to view the workshop as a comprehensive but flexible curriculum, allowing them to focus on specific areas of interest. Recognizing variations in proficiency levels and familiarity with RStudio among learners, we have designed this workshop to be flexible, allowing for the abbreviation or skipping of episodes to cater to specific needs:
Module 1 - Reproducibility and Project Organization: This module consists of two episodes (1. Scientific reproducibility: What is it for?, and 2. Good Practices for Managing Projects in RStudio) which introduce learners to reproducible research and project management fundamentals. It lays the groundwork for a robust and transparent workflow, ensuring that all participants, whether beginners or those seeking a refresher, are on the same page before delving into the specifics of Quarto and RStudio Posit.
Module 2 - Quarto and RStudio: This module focuses on Quarto and its features for creating dynamic and reproducible documents. We guide learners through the ins and outs of Quarto, helping them harness this authoring framework and the tool’s potential to create visually appealing, easily reproducible, and shareable documents. This central module forms the bulk of the workshop, consisting of eight sessions that guide participants from the fundamentals of RStudio to advanced Quarto document features. Participants will build practical skills for creating reproducible, well-structured documents, including integrating code, styling content, managing projects, and handling references. Episodes included in this module are: 3. Navigating RStudio and Quarto Documents, 4. Working with Projects in RStudio, 5. Introduction to Working with Quarto Documents, 6. Writing and Styling Qmd Documents, 7. Adding Code to Quarto Documents, 8. Rendering & Customizing Code Outputs, 9. Advanced Code Chunk Options, and 10. Bibliography, Citations & Cross-Referencing
Module 3 - Collaboration: This final module includes the remaining file episodes (i.e., 11. Using Git in RStudio, 12. Collaborating via GitHub, 13. Managing Dependencies in R/RStudio, 14. Publishing your project, 15. Creating and sharing reproducible environments with renv) shifts the focus to collaboration and publishing. It explores effective collaboration with others, using version control within RStudio, pushing local changes to a remote repository, managing dependencies for R/Quarto projects, and sharing reproducible research with a broader audience.
Experience in R/RStudio is recommended but not required. Experience, if not familiarity, with using your Unix Shell Terminal, and Version Control with Git is required. You will need a GitHub Account to fork and pull the example repo.
PART I: Install Git and create a GitHub Account
We will need the following accounts and software for this workshop:
- Create GitHub account (use existing or create a new account)
- Install Git
- Install R & RStudio (Two separate installations: if you are on a Windows device, you may need Rtools.
For the most up-to-date instructions for creating your GitHub account and installing Git, please follow the steps described in Software Carpentry’s Version Control with Git lesson.
Git
Git is a version control system that lets you track who made changes to what, when, and has options for easily updating a shared or public version of your code on GitHub.
Additional GitHub information
Through the Github education program, students get additional free services beyond the basic free account.
If you are concerned about what personal information (specifically contact information) is revealed through GitHub you may review these instructions for keeping your email address private provided by GitHub.
PART II: Install R/Rstudio and Quarto
R
R is a powerful programming language for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio.
Follow the installation instructions provided here to install R and RStudio.
Quarto
Quarto is a scientific and technical publishing system built on Pandoc that we will use in RStudio. Quarto has been bundled with RStudio in recent versions. If you have the most up-to-date RStudio version, you shouldn’t to install Quarto.
Version clarifications on Quarto and R/Rstudio
If you already have RStudio and R installed, please check if you have the most recent RStudio version and at least R version 4.3, along with Quarto version 1.3.45 at least. The quarto document will not render without the most up-to-date versions. The Quarto Package is not the CLI.
You can check if you have the correct Quarto version by typing the following in the RStudio terminal:
quarto --version
Your output should be:
OUTPUT
quarto --version
1.4
R Packages
Install the following packages in RStudio: rmarkdown,
tidyverse,BayesFactor, patchwork.
We will be covering the purpose of using packages and recap different
ways to install and manage them in RStudio. Nonetheless, pre-installing
the packages we will use for this workshop will save us some precious
time, since installation time may vary among learners. Here are the
steps for two possible approaches you may follow for completing this
process: