在区块中运行系统调用后,如何让call取消挂起?例如:
\documentclass{article}
\begin{document}
Test
<<>>=
system('"C:\\Program Files\\SASHome\\SASFoundation\\9.3\\sas.exe" "test.sas"')
@
\end{document}这段代码将永远挂起。顺便说一下,上面的R代码运行得很好。谢谢。
发布于 2012-11-09 06:30:51
默认情况下,代码块的工作目录是源文档的目录(本例中为Rnw doc ),因此test.sas必须与Rnw文件在同一目录下。
或者,您可以使用opts_knit$set(root.dir = '/path/to/desired/dir/')指定代码块的工作目录。
development version中已经添加了knitr中的SAS支持,您可以执行以下操作:
<<engine='sas', engine.path="C:\\Program Files\\SASHome\\SASFoundation\\9.3\\sas.exe">>=
/* write the content of your test.sas here */
@https://stackoverflow.com/questions/13295130
复制相似问题