[R] defmacro and bwplot incompatibilities?

Geoffrey lordgeoffrey at optusnet.com.au
Sun Dec 9 12:11:34 CET 2012

My macro doesn't work for bwplot. But is working elsewhere.
What changes should i make to fix my macro.

The complete code sample is:

pic <- defmacro(fn, plotfunc, expr={png(filename=fn); plotfunc; dev.off()})

# this one fails.
pic("bw.png", {bwplot(Species ~ Sepal.Length, data=iris)})

# this one works
pic("p.png", {plot(iris$Sepal.Length)}

More information about the R-help mailing list