在Rstudio中编织-在PDF中未显示任何图 [英] Sweave in Rstudio -- no plots showing in pdf

查看:60
本文介绍了在Rstudio中编织-在PDF中未显示任何图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此处编织/Latex新手.我生成常规函数输出没有问题,但是这些图没有显示出来.这是一个基本示例:

Sweave/Latex newbie here. I have no problems generating regular functions outputs, but the plots don't show up. Here's a basic example:

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

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

\end{document}

以及相应的.tex输出:

And the corresponding .tex output:

\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上都尝试了相同的结果.我想念什么?

I am running Rstudio version 0.98.501. I use Texlive, and tried on both Windows and Linux with the same results. What am I missing?

推荐答案

您需要在钩子中放入 fig = TRUE .看起来应该像这样:

You need to put fig=TRUE in the hook. It should look like:

<<chunk1,fig=TRUE>>=

然后再试一次!

这篇关于在Rstudio中编织-在PDF中未显示任何图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆