【发布时间】:2026-01-16 12:55:01
【问题描述】:
我从@AnandaMahto 编写的here 中获取了以下代码。此功能之前运行良好,但停止使用 R 3.1.1 和 knitr 1.6.10。
\documentclass{article}
\begin{document}
<<echo=FALSE>>=
library(devtools)
source_gist("https://gist.github.com/mrdwab/7586769")
@
\Sexpr{knit_child(textConnection(helpExtract(cor, section="Arg", type = "s_text")),
options = list(tidy = FALSE, eval = FALSE))}
\Sexpr{knit_child(textConnection(helpExtract(cor, type = "s_code")),
options = list(tidy = FALSE, eval = FALSE))}
<<tidy=TRUE>>=
## normal R code
args(lm)
@
\end{document}
【问题讨论】:
-
看看@AnandaMahto 有没有解决办法。
-
奇怪。如果函数的内容是逐行运行的,它们似乎输出了预期的内容....
-
@AnandaMahto:对你有用吗?
-
我认为
source_gist有问题。如果我在 .Rnw 中定义函数,这将有效。 -
@kohske,为什么会这样?