library(decampr)

Prepping your DataCamp Repo

decampr is based on some rather fragile regular expressions, particularly for extracting the exercise code. It assumes that you have at least two linebreaks separating each exercise. That is:

\*\*\* =sct
\`\`\`{r}
success_msg("Great! You learned some basics about `data.frame`s! Let's move on.")
test_function("colnames", incorrect_msg = "did you use colnames(gap1992)?")
test_function("nrow", incorrect_msg = "did you use nrow(gap1992)")
`` ``` ``
              \#\# <- Note there are two line breaks, here
              \#\# <- and here!
--- type:MultipleChoiceExercise lang:r xp:100 skills:1 key:d599f92ec8
\#\# Thinking about aesthetics
Now that we've learned a little about the `data.frame`, we can get to the fun part: making graphs.

Comments should not have whitespace after the #:

##proper comment
## improper comment (will be parsed incorrectly)

Also, make sure the last exercise in your chapter has at least two linebreaks and is followed by a ---.

Using decampr

decampr assumes that your datacamp repo is local to your system.

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.

Now you can start processing your DataCamp repo:

Exercises/solutions/pre-exercise code will be written to exercises/ and the chapter.md files will be written to chapters/.

Note that submission correctness tests are not currently captured, nor is the correct answer to the multiple choice exercise captured. The correct answer can be added to that exercise by editing the appropriate chapter.md file (see Ines` documentation for more info).