Skip to content

output a sequence of plots

3 messages · Paul E. Green, vincent@7d4.com, Don MacQueen

#
Paul E. Green a ??crit :
as a toy example, with some of the usable functions :
(see ?dir)

fct00 = function()
{
rep0 = "data";	
fichier = dir(rep0, pattern="*.emf");
nbfichiers = length(fichier);

for (i in 1:nbfichiers)
	{
#	do the job
	}
}
#
Something similar to this
(but I haven't tested)

mydf <- data.frame(xx=rnorm(100), yy=rnorm(100), zz=rnorm(100))

for (nm in names(mydf)) {

   fnm <- file.path('c:',paste(nm,'.emf',sep=''))
   cat('Creating histogram in file',fnm,'\n')
   win.metafile( filename=fnm)
   hist(mydf[[nm]])                                          # or 
hist(mydf[,nm])
   dev.off()

}

-Don
At 11:54 AM -0400 10/5/05, Paul E. Green wrote: