Try this: f <- function(cmd, ...) { cat("Hello\n") mc <- match.call() mc <- mc[-1] eval.parent(mc) cat("Goodbye\n") } f(plot, 1:10)
On Wed, Nov 19, 2008 at 8:57 AM, Roberto Brunelli <[EMAIL PROTECTED]> wrote: > I'm trying to write a simple wrapper for plotting functions to make > them print to postscript, something like > > ploteps <- function(file, plotFunction, ...) { > > args <- list(bquote(...)) > > # prepare postscript device > > do.call(plot, args) > > # close postscript device > } > > I have inserted the bquote otherwise I get a lot of numbers in the > plot when I plot/hist something. But if I invoke the function as > > ploteps("foo.eps", hist, xlab = "X") > > I get > > Error in bquote(...) : unused argument(s) (xlab = "X") > > What am I messing up? > > > Thanks a lot, > > ______________________________________________ > 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. > ______________________________________________ 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.