recommendation评论.Rmd
文件使用HTML评论<!-- comment here -->
是不够的。我要评论我的文档的一部分,包括内嵌的评价:评论rmarkdown/knitr以防R评估
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 -->
针织失败:
# |.................................................................| 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
一个选择是每个评内嵌部分:
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
但是,如果我想用几个这样的内联计算来评论整个段落,则会受到影响。有没有更具规范的方式来做到这一点?
不完全确定我的理解,但如果问题是注释掉许多内联R语句,可能是关键字搜索并在文本编辑器中替换?像*选择paragaph *然后'Ctrl-f>找到“\'r”替换“\'r#”'。 – lmo
@lmo我的意思是,当然。我想也许这是更多的功能要求然后....是否有任何理由'knitr'不承认代码嵌入在评论中,并跳过评估? – MichaelChirico
这是一个很好的问题。我只是试了一下,看看你的意思。在这种情况下,评论被忽略是很奇怪的。 – lmo