Description Usage Arguments Details
View source: R/code_comments.R
Often the scaffolding put in a {learnr}
exercise chunk consists of
more than one command that produces output. By default, {learnr}
will
print the outputs one after the other. This can make it hard for the reader
to determine which line of code produced which output. announce()
can insert comments
into the output.
1 |
code |
the code that you want to display |
comment |
A character string to print as a comment |
Use announce()
in either of two ways:
As a simple function call, e.g. announce("my message")
which will display
"my message" as a comment at the corresponding point in the exercise chunk output.
As the receiver of a piped-in command, e.g. sqrt(2 + 3) %>% announce("my message")
. This
will print out the code on the LHS of the pipe, along with the message as a comment.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.