Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 10:03 AM, Ed Siefker wrote: > > I don't really understand. I mean, I understand the solution is > print(ggplot(...)). But why is that required in a function and not at > the console? The REPL design of the interactive console is offered the user as a convenience, but I ag

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Duncan Murdoch
On 02/11/2017 1:03 PM, Ed Siefker wrote: I don't really understand. I mean, I understand the solution is print(ggplot(...)). But why is that required in a function and not at the console? Shouldn't I be able to rely on what I do at the console working in a script? Is this inconsistent behavior

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Richard M. Heiberger
FAQ 7.22 Open the file indicated by system.file("../../doc/FAQ") and scroll down to 7.22 On Thu, Nov 2, 2017 at 1:03 PM, Ed Siefker wrote: > I don't really understand. I mean, I understand the solution is > print(ggplot(...)). But why is that required in a function and not at > the console? >

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Ed Siefker
I don't really understand. I mean, I understand the solution is print(ggplot(...)). But why is that required in a function and not at the console? Shouldn't I be able to rely on what I do at the console working in a script? Is this inconsistent behavior by design? On Thu, Nov 2, 2017 at 11:54

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 9:27 AM, Ed Siefker wrote: > > I have a function: > > myplot <- function (X) { >d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) >png(paste("img/", X, ".png", sep="")) >ggplot(d, aes(x=condition, y=count, color=condition)) + >geom_poi

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread PIKAL Petr
Hi You have to print it. just add print(all ggplot stuff) inside the function. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ed Siefker > Sent: Thursday, November 2, 2017 5:27 PM > To: r-help > Subject: [R] ggplot inside function d