I need to make a bunch of PDF files of histograms. I tried
gatelist = unique(mdf$ArrivalGate)
for( gate in gatelist) {       
    outfile = paste("../", airport, "/", airport, "taxiHistogram", gate,
".pdf", sep="")
    pdf(file = outfile, width = 10, height=8, par(lwd=1))

    title=paste("Taxi time for Arrival Gate", gate, "by Runway at", airport)
    gdf = mdf[mdf$ArrivalGate == gate, ]
    gdf$tt= gdf$TaxiTime/60           
    histogram(~(gdf$tt) | gdf$Runway, data=gdf, type="count",
ylab="Count",    breaks=20, main=title,
                        xlab="taxi time (min)",  
par.strip.text=list(cex=0.7))
    dev.off()
}

But when I do this, the pdf files are all empty. If I eliminate the call
to pdf() and dev.off(), and step through the loop manually, the
histograms still do not plot, even though any one of them will plot.

What am I doing wrong?

Thanks,
Jim Rome

______________________________________________
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