【问题标题】:knitr chunk option code to input code into a chunk does not work in R 3.1.1 with knitr 1.6.10将代码输入到块中的 knitr 块选项代码在 R 3.1.1 和 knitr 1.6.10 中不起作用
【发布时间】:2014-07-27 17:15:48
【问题描述】:

我在R 3.1.1 中使用knitr 1.6.10。块选项code 似乎不起作用。我的.Rnw 格式的 MWE 如下:

\documentclass{article} 

\begin{document}
<< packages, include=FALSE, cache=FALSE>>=
library(knitr)
library(formatR)
@

<<test, code=formatR::usage(lm), eval=FALSE>>=
@

\end{document}

以前这个函数可以工作 (See here),但即使 formatR::usage(lm) 在块代码之外工作,它也不能工作。

【问题讨论】:

    标签: r latex knitr sweave formatr


    【解决方案1】:

    The answer you mentioned 已声明 formatR 版本必须 >= 0.10.3,这是一个开发版本。

    devtools::install_github('yihui/formatR')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-29
      • 2021-09-02
      • 1970-01-01
      • 2018-12-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多