Comment out text in R Markdown (Rmd file)

In an R Markdown (.Rmd) file, how do you comment out unused text? I'm not referring to the text in the R code chunk, but the general texts, like % in LaTex for example.


I think you should be able to use regular html comments:

<!-- regular html comment --> 

Does this work for you?


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.