【问题标题】:Sweave in Rstudio -- no plots showing in pdf在 Rstudio 中 Sweave - pdf 中没有显示图
【发布时间】:2014-04-23 02:31:07
【问题描述】:

在这里编织/乳胶新手。我生成常规函数输出没有问题,但图没有显示。这是一个基本示例:

\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}

<<chunk1>>=
print("Hello World")
boxplot(rnorm(100))
@

\end{document}

以及对应的.tex输出:

\documentclass{article}
\usepackage{Sweave}
\begin{document}
\input{test2-concordance}

\begin{Schunk}
\begin{Sinput}
> print("Hello World")
\end{Sinput}
\begin{Soutput}
[1] "Hello World"
\end{Soutput}
\begin{Sinput}
> boxplot(rnorm(100))
\end{Sinput}
\end{Schunk}

\end{document}

我正在运行 Rstudio 版本 0.98.501。我使用 Texlive,并在 Windows 和 Linux 上进行了尝试,结果相同。我错过了什么?

【问题讨论】:

    标签: r latex rstudio sweave


    【解决方案1】:

    您需要将fig=TRUE 放入钩子中。它应该看起来像:

    <<chunk1,fig=TRUE>>=
    

    然后再试一次!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-28
      • 1970-01-01
      • 2021-12-19
      相关资源
      最近更新 更多