[R] Sweave question

Felipe Carrillo mazatlanmexico at yahoo.com
Thu Apr 29 16:34:20 CEST 2010


Thanks Duncan it does exactly what I want, how do I get my options back to 
print graphics on computer screen? I tried options(device="screen") but didn't work.
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA



----- Original Message ----
> From: Duncan Murdoch <murdoch.duncan at gmail.com>
> To: Felipe Carrillo <mazatlanmexico at yahoo.com>
> Cc: r-help at stat.math.ethz.ch
> Sent: Thu, April 29, 2010 4:12:58 AM
> Subject: Re: [R] Sweave question
> 
> On 28/04/2010 11:31 PM, Felipe Carrillo wrote:
> 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.  

Sweave runs 
> figure chunks multiple times.  The first time is probably what you're 
> seeing:  it just runs the code, with no special devices created.  You 
> need to tell R to use something other than your screen as the default device for 
> this.  That's what happens if you run Sweave in batch mode, or if you 
> choose options(device="pdf").  (You'll get a file Rplots.pdf 
> created.)

Duncan Murdoch
> 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
> 
>  Felipe D. 
> Carrillo
> Supervisory Fishery Biologist
> Department of the 
> Interior
> US Fish & Wildlife Service
> California, USA
> 
> 
> 
> 
> 
> 
> ______________________________________________
> > ymailto="mailto:R-help at r-project.org" 
> href="mailto:R-help at r-project.org">R-help at 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.
>  






More information about the R-help mailing list