I am trying to include figures in my Sweave report. I have a file 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}
I generate the tex as:
$ R CMD Sweave a.Rnw
Output file: a.tex
However, no figure is generated.
$ 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}
?
There is no such file
$ ls a-001*
ls: a-001*: No such file or directory
The generated tex is
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{Sweave}
\begin{document}
\includegraphics{a-001}
\end{document}
So how do I generate the figure?