[R] Extra \input command in Sweave created figures.

Fredrik Karlsson dargosch at gmail.com
Tue Apr 18 13:19:07 CEST 2006


Dear list,

I am using Sweave to generate figures and tables for my thesis. Now, I
have run into the problem that all of a sudden, Sweave produces not
only an \includegraphics command, but a
\include command as well. This breakes LaTeX processing.

This is an example:

The code:


\begin{figure}[htbp]
  \centering
<<mannerSimpleSkal,fig=T,height=5>>=
sel <-   mannerDF$target %in% c("skal","kal","sal","gal") &
mannerDF$onsetLength == 1
print(
      dotplot(
              prop.table(table(mannerDF$agem[sel],mannerDF$target[sel],mannerDF$manner[sel]),1)
              ,auto.key=list(
                 space="right"
                 )
              )
      )
@
\caption[Relative frequence of occurence for each manner of
    articulation in simple productions of Skal,kal,gal and
    sal]{Relative frequence of occurence for each manner of
     articulation in simple productions of the skal,kal,gal and sal
     target words.}
  \label{fig:manner-skal-simple}
\end{figure}

Produces this LaTeX output when run through Sweave:



\begin{figure}[htbp]
  \centering
\input{manner-mannerSimpleSkal}
\includegraphics{manner-mannerSimpleSkal}
\caption[Relative frequence of occurence for each manner of
    articulation in simple productions of Skal,kal,gal and
    sal]{Relative frequence of occurence for each manner of
     articulation in simple productions of the skal,kal,gal and sal
     target words.}
  \label{fig:manner-skal-simple}
\end{figure}

What is causing the extra \input? I had this problem once before, but
was enable then to fix the problem by randomly adding and removing
blank space. Now, this problem seem to have occured in 18 figures,
which means I would like to find the acctual problem this time rather
than trying to remove the symptoms.

Thankful for all the help I could get.

/Fredrik




More information about the R-help mailing list