knitr::opts_chunk$set(echo = TRUE)

Styles to be included at the top of the document

Code hint

More than one hint possible.


Markdown (text) hint

Only one hint possible.

__Hint:__ hinttext.

Programming Tip

__Programming Tip__ -

Exercise with result checker


gradethis::grade_result(
  pass_if(~ identical(.result, correct_result), "message"),
  fail_if(~ identical(.result, wrong_result), "message")
)

Exercise with conditions checker


# every pass_if condition must be satisfied
gradethis::grade_result_strict(
  pass_if(~ identical(.result, correct_result), "message"),
  fail_if(~ identical(.result, wrong_result), "message")
)

Exercise with code checker


__Hint:__ hinttext.

Or add , exercise.reveal_solution = FALSE to the solution chunk options:

"replace this by the correct code (pipe as one line)"
gradethis::grade_code(
  correct = "message", 
  incorrect = "message"
  )

Quiz

quiz(
  caption = "",
  question("Which package contains functions for installing other R packages?",
    answer("base"),
    answer("tools"),
    answer("utils", correct = TRUE),
    answer("codetools")
  ),
  question("Which of the R packages listed below are used to create plots?",
    answer("lattice", correct = TRUE),
    answer("tools"),
    answer("stats"),
    answer("grid", correct = TRUE)
  )
)

Installation

Starting a tutorial

Notes on learnr

IMPORTANT:

Notes on gradethis

Exercise setup (preparing data etc.):

With grade_code():

With grade_result():

Comparing ggplots:



WdeNooy/UsingRTutorials documentation built on Jan. 25, 2023, 2:39 a.m.