Developing course material and workflows based in R for undergraduate UofT Environmental Chemistry courses.
Online book found here: https://uoftchem-teaching.github.io/R4EnvChem/.
-
Clone this repository:
$ git clone https://github.com/UofTChem-Teaching/R4EnvChem.git -
Open R4EnvChem project from RStudio.
-
Run the following command in the Console to install the necessary libraries for this book:
renv::restore()
-
Build the book in HTML format in the upper-right Build window in RStudio, selecting the "bookdown::gitbook" option.
If you encounter an error with no package installed issue, install the missing packages first. During the building process, a new file
R4EnvChem.Rmdis automatically created. Once the book is built (it can take up to couple minutes), the html of the book will show up in theViewerwindow.All the build-related files created during the process will be deleted once the HTML viewer appears.
-
Make changes by modifying the source files under the
src/folder. Each time you make a change, you should rebuild the book (Step 4) to verify that your changes are rendered correctly. -
When you are ready, publish your changes to GitHub. You can do this using git commit and git push, or using the GitHub Desktop application.
This GitHub repository is configured to automatically render and publish changes directly to the live online textbook, though it may take a few minutes to do so. Track progress on the repository Deployments page. For details, look at
.github/workflows/gh-pages.yml.
The chapter exercises are stored under the exercises folder.
A separate copy of all exercises are stored in the R4EnvChem-Exercises repository; we use a separate repository so that we can provide an nbgitpuller link to students to quickly load all exercises into the University of Toronto JupyterHub computing environment.
Solutions for all exercises are found in the R4EnvChem-Instructor repostory (contact Jessica D'eon for access).
Note: with multiple copies of exercises, it's important to keep them all up to date! Changes to exercises should first be done in the instructor repository (to ensure reference solutions are also updated), and then the parallel changes should be made to the student-facing versions in this repository and in the R4EnvChem-Exercises repository.
Each exercise is accompanied by an R script containing tests for the exercise. After completing the exercise, you can run the R script to check that the tests all pass, meaning you've completed the exercise correctly.
