Comment out text in R Markdown (Rmd file)
Extra yaml blocks can be used anywhere inside the document, and commented out with #
---
title: "Untitled"
output: html_document
---
No comment.
---
# here's a comment
# ```{r}
# x = pi
# ```
---
Note however that this does not prevent knitr from evaluating inline r code.
After drag the lines you want to make comment, press SHIFT+CMD+C (macOS), SHIFT+CTRL+C (Windows). This is the shortcut of R Markdown editor (R Studio) to comment out.
I think you should be able to use regular html comments:
<!-- regular html comment -->
Does this work for you?