Comments in bookdown

The comment symbol is # in R code. You can explicitly set a comment character (or character combination) in an RMarkdown document as a parameter, if you so choose. Bookdown uses pygments, I believe, for syntax highlighting, which might be different from what you use in another RMarkdown-generated thing (e.g. for blogdown I use highlight.js).

Using the # symbol for comments is pretty well-established, so I'd recommend using it over > which often indicates a prompt in the R console.
http://r.789695.n4.nabble.com/How-to-comment-in-R-td882882.html

1 Like