Using decampr to create a course repo from scratch

The first thing to do is to use decampr::create_course_repo() to clone Ines’ basic course repository to your computer:

This will clone the course-starter-r repo to your computer (by default, it saves it to your Desktop) and open up a new project with your cloned repo.

Make sure to rename it and save it as a new project. Also, use use_github() to add it to GitHub, so you can serve the repository up to both your webhost and

Adding a new chapter file.

We’ve got you covered. You can use add_chapter() to initialize a new chapter file and open it automatically.

Say I wanted to add a new to my course. I can use


And this file will be created, along with the relevant YAML to get the course to work.

I can then start adding exercises using the add_exercise() function (see below).

Adding an exercise to the end of your chapter

If you want to expand on your work, there is another convenience function called add_exercise():

add_exercise("", "01_10")

Which will add a new set of HTML exercise tags for your exercise to your file, and will open this file for further editing. Furthermore, the exercise, solution, and pre-exercise files will be open.

Note that if you already have a codeblock with that id, function will return an error, preventing you from overwriting the files.

Editing Individual Exercises

The open_exercise() function will open the exercises in Rstudio with a particular_id. For example, if I wanted to edit the 03_03 exercise, solutions, and prexercise code (which would be exercises/exc_03_03.R, exercises/solution_03_03.R and exercises/preexercise_03_03.R), I could use:


And edit windows for each of these files would pop up.

TODO: add_multiple_choice()

Coming soon!

TODO: add_slides()

Coming soon!