The recommendation for commenting in .Rmd
documents to use HTML commenting <!-- comment here -->
is insufficient. I'd like to comment out a section of my document that includes inline evaluations:
I haven't defined `x` yet.
<!-- So when I say that `x` is `r x` in the text, I'd like to comment it out -->
Knitting this fails:
# |.................................................................| 100%
# inline R code fragments
#
#
#
#
# processing file: test.Rmd
# Quitting from lines 2-3 (test.Rmd)
# Error in eval(expr, envir, enclos) : object 'x' not found
# Calls: <Anonymous> ... in_dir -> inline_exec -> withVisible -> eval -> eval
# Execution halted
One option is to comment each inline section:
I haven't defined `x` yet.
So when I say that `x` is `r #x` in the text, I'd like to comment it out
But this suffers if I'd like to comment out a whole paragraph with several such inline calculations, for example. Is there a more canonical way of doing this?