Apologies for the noob question. I need to split setting up a plot and drawing
it into two functions. One determines the properties of a plot (data, axis,
labels, etc.), and the other plots it (using a preferred device, image
dimensions, etc.).

get.props = function() {
  list(x=x, y=y, xlab="foo", ylab="bar")
}

myplot = function() {
  props = get.props()
  plot(props) # Doesn't work
}

What's the right way to call plot() with all the components of props broken out
as separate parameters to plot()? Note that the components of props may be
different from call to call (sometimes there's only x data, sometimes there's no
ylab, etc.).

Thanks in advance for your time and help.

______________________________________________
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