我有以下结构的文档。
\documentclass[11pt]{article}
\begin{document}
\title{Something}
\author{Andreas}
\date{May 8th, 2013} \maketitle
\section{Introduction}
\paragraph{...}
<<>>=
2+2
@
<<>>=
require('tm')
@
\begin{itemize}
\item{asdf}
\end{itemize}
some text here.
\section{Intro}
More text.
\section{Other Stuff}
<<>>=
pdf <- readPDF(PdftotextOptions = '-layout')
@
<<eval=FALSE>>=
text <- pdf(elem = list(uri = file.name),
language = 'en',
id = 'id1')
@
\end{document}
当我在 R 中运行以下命令时,出现以下错误:
knit('test.rnw')
processing file: test.rnw
|....... | 11%
ordinary text without R code
|.............. | 22%
label: unnamed-chunk-1
Quitting from lines 12-13 (test.rnw)
Error in pdf_doc(file, cache = FALSE) :
'file' must be a character string or a file/raw connection
我不理解这个错误,并且似乎无法始终如一地复制该问题。我从一个空白文档开始,添加了一些工作正常的 R 代码。然后,我到达了它停止正确编译的地步。然后似乎我可以删除最近添加的代码块,但我仍然得到同样的错误。
会话信息:
R version 3.0.0 (2013-04-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tm_0.5-8.3 knitr_1.2
loaded via a namespace (and not attached):
[1] digest_0.6.3 evaluate_0.4.3 formatR_0.7 slam_0.1-28 stringr_0.6.2
[6] tools_3.0.0
有什么建议么?如果需要更多信息,请告诉我。谢谢你。