[R] How can we let "multiplot.R" return a plot?

2016-01-14 Thread jpm miao
Hi, The function "ggplot" does plot and return a plot. For example, we can write: y = ggplot(.. .) Then y is a plot. How can we modify the multiplot function so that it can also return a plot? Multiplot.R is here:

Re: [R] How can we let "multiplot.R" return a plot?

2016-01-14 Thread Jim Lemon
Hi Miao, If I understand your question correctly, you want to get a return value from the "multiplot" function that you have copied into your message. You could simply add: return(plotlist) just before the final right brace in the function and it would return the list of plots that you have

Re: [R] How can we let "multiplot.R" return a plot?

2016-01-14 Thread David Winsemius
> On Jan 14, 2016, at 9:26 PM, jpm miao wrote: > > Hi, > > The function "ggplot" does plot and return a plot. For example, we can > write: > > y = ggplot(.. .) Then y is a plot. > > How can we modify the multiplot function so that it can also return a > plot?