In a .Rnw file I want to insert the R command
pairs(mydataframe)
and achieve the following effects

1. the command itseld is echoed into the tex document generated by Sweave
<<fig=TRUE,echo=TRUE>>=
2. The graphics generated appears in the tex document, with the graphics
centred.
3. The R command > pairs(mydataframe) is not centered.

Sweave-manual.pdf gives the following code chunk

<<results=tex,echo=FALSE>>= 
for(i in 1:4){ 
file=paste("myfile", i, ".eps", sep="") 
postscript(file=file, paper="special", width=6, height=6) 
plot(rnorm(100)+i) 
dev.off() 
cat("\\includegraphics{", file, "}\n\n", sep="") 
} 
@ 

This could obviously be adapted to my centering problem, but is it the
simplest way? It seems complicated compared with just pairs(mydataframe).
Also, Sweave will normally make both postscript and pdf plots, but this
would involve further complication in the code. I'm sure it's completely
standard to produce two copies of graphics, one a pdf and one an eps, but
it's another obstacle in my way when I want to get on with writing the
program and its latex description.

Thanks
David
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Sweave-centering-with-echo-TRUE-tp2065018p2065018.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to