[R] jpeg device loop problem

David Winsemius dwinsemius at comcast.net
Tue Aug 25 02:31:26 CEST 2009


On Aug 24, 2009, at 8:19 PM, AllenL wrote:

>
> Dear R gurus,
> Trying to loop a graphing function and output a jpeg file each loop.  
> It
> works fine for a single run (ie. not looping) but when I loop the  
> output is
> nothing but white space.
> Here is my code, somewhat abridged:
>
> {
> <rest of loop>
>  jpeg(filename=<"name for this loop.jpeg">)

You will need to be sure that you are not overwriting. What is the  
code that sequences through the names?

>  xyplot(AbvBioAnnProd~Year|factor(Plot), type = c("b", "r"), pch =
> 16,data=dd.mono.i,main=<"name for this loop">)

Inside loops, you generally need to print() lattice objects.

>  dev.off()
> }
>
> Is there a problem with my device settings? As I noted above it  
> works once
> but not when repeated. I'm afraid I do not understand the  
> implementation of
> the devices well enough to know. Is there a good graphics tutorial  
> you could
> point me to?
>
> Thanks!
>
>
> -- 
> View this message in context: http://www.nabble.com/jpeg-device-loop-problem-tp25123895p25123895.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list