2

Sweave レポートに数値を含めようとしています。ファイル a.Rnw があります。

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

<<echo=FALSE, fig=TRUE>>=
plot(c(1,3,5,2,4,2,4,2,42,3,2,3))
@

\end{document}

tex を次のように生成します。

$ R CMD Sweave a.Rnw 
Output file:  a.tex

ただし、図は生成されません。

$ pdflatex a.tex 
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
...
! LaTeX Error: File `a-001' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.11 \includegraphics{a-001}

? 

そのようなファイルはありません

$ ls a-001*
ls: a-001*: No such file or directory

生成されたテックスは

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}


\usepackage{Sweave}
\begin{document}

\includegraphics{a-001}

\end{document}

では、どうすれば図を生成できますか?

4

0 に答える 0