[R] results=hide?

Felipe Carrillo mazatlanmexico at yahoo.com
Wed Apr 28 23:55:42 CEST 2010


Hi:
I am using Sweave and texi2dvi to generate a LaTeX document but
can't find the way to hide the graphics while the R chunks are being
executed. I thought results=hide would do it but that't not the case. 
If I do:
\begin{figure}[h]
<<figA=true,echo=F,fig=T,results=hide>>=
a < rnorm(1000)
plot(a)
@
\caption{Weekly estimates.}
\label{figure:ggplot1}
\end{figure}

The graphic doesn't get displayed but gets printed on the document

but the code below shows the graphic.......how can I hide it??
\begin{figure}[h]
<<figA=true,echo=F,fig=T,results=hide>>=
library(ggplot2)
winter <- read.csv("Winter_AllYears.csv")
wintermelt <- melt(winter,id="week")
print(ggplot(wintermelt,aes(week,value/1000)) + geom_line(aes(colour=variable))+ opts(legend.position="none") +
facet_wrap(~variable,ncol=2) + opts(title="Winter") + labs(y="Number of fish X 1,000",x="WEEK"))
@
\caption{Weekly estimates.}
\label{figure:ggplot1}
\end{figure}
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA






More information about the R-help mailing list