Comment out the text in R Markdown (Rmd file)

How do you comment on unused text in the R Markdown ( .Rmd ) file? I do not mean the text in the R code block , but the general texts, for example, % in LaTex .

+93
r markdown knitr r-markdown
Jun 11 '13 at 14:24
source share
3 answers

I think you can use regular html comments:

 <!-- regular html comment --> 

Does this work for you?

+143
Jun 11 '13 at 14:50
source share

Blocks with an extra hole can be used anywhere inside the document and commented out with #

 --- title: "Untitled" output: html_document --- No comment. --- # here a comment # ```{r} # x = pi # ``` --- 

Note that this does not prevent knitr from evaluating the embedded code r.

+22
Oct 23 '17 at 1:45 on
source share

After dragging the lines you want to comment, press SHIFT + CMD / WIN + C. This is the shortcut of the R Markdown editor (R Studio) for commenting.

+1
Apr 24 '19 at 2:18
source share



All Articles