Dear SOers,
I am writing my thesis in LaTeX and because things got a bit long for my taste, I had split it into several files. Let's call them thesis.tex
, intro.tex
, mat_n_met.tex
, rslts.tex
and discsn.tex
. I have linked intro.tex
, mat_n_met.tex
, rslts.tex
and discsn.tex
through thesis.tex
with \include{intro}
(and so on...).
I have also created a separate file called r_crunching.Rnw
(that I run through Sweave) that holds a chunk that runs the R script with data analysis and chunks that produce pdf outputs of graphs that I embed via \includegraphics
(in e.g., rslts.tex
). Still following?
If I run a Rnw (i.e. I renamed rslts.tex
to rslts.Rnw
) without "a link" to the chunk with the R script, you will get a Sweave()
error saying the reference in \Sexpr{}
doesn't exist. Is there a way, without merging all the files into a single .Rnw, to call \Sexpr{}
in say rslts.Rnw
?
Other methods how to accomplish this are welcome.