You can use the tutorial
package to convert static code chunks into ‘fiddles’, i.e. editors where people can experiment with your code. If you specify the ex
and type
properties, tutorial
knows what to do:
You can also create interactive exercises right inside your R Markdown document. Suppose you want to explain people how variable assignment works in R. Create an exercise with a certain identifier, create_a
in this case. Then, in different R code chunks, specify the elements of the exercise by setting the type
inside the code chunk options.