[R] Export bug? Hist() vs. barchart().

Jeff Brown dopethatwantscash at yahoo.com
Sun Apr 4 01:20:11 CEST 2010


Hi,

If you want to export a single bar chart, this works:
> png( "ET" );
> barchart( data[,"ET"] )
> dev.off()
quartz_off_screen 
                2 

But if you want to export a few of them, this does not:
> factorCols <- c("MR","ET");
> sapply( factorCols,	function(x) {
+ 	png( x );
+ 	barchart( data[, x] );
+ 	dev.off();
+ } );
MR.quartz_off_screen ET.quartz_off_screen 
                   2                    2 

R gives no indication of an error, but the files do not appear in the
working directory as they should.  Why is that?

I'm led to suspect this is a bug, because it works fine if you use hist()
instead of barchart():
> factorCols <- c("YR","AG");
> sapply( factorCols,	function(x) {
+ 	png( x );
+ 	hist( data[, x] );
+ 	dev.off();
+ } );
YR.quartz_off_screen AG.quartz_off_screen 
                   2                    2 

Thanks,
Jeff
-- 
View this message in context: http://n4.nabble.com/Export-bug-Hist-vs-barchart-tp1750593p1750593.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list