Re: [R] ggplot does not show in knitr

2012-08-03 Thread firdaus.janoos
Hi Michael, Thanks a lot - enclosing the qplot in a print() worked perfectly ! Regards, -fj On Thu, Aug 2, 2012 at 7:37 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > On Thu, Aug 2, 2012 at 6:30 PM, Dennis Murphy wrote: > > On Thu, Aug 2, 2012 at 1:38 PM, Michael Weylandt > >

Re: [R] ggplot does not show in knitr

2012-08-02 Thread R. Michael Weylandt
See R FAQ 7.22 for the gory details -- It needs to go around the qplot() statement. In interactive use, most objects are "printed" after evaluation: sometimes this doesn't happen because the returned value is marked invisible. For grid graphics objects (of which ggplot objects are a type), this "p

Re: [R] ggplot does not show in knitr

2012-08-02 Thread firdaus.janoos
Could you elaborate on this ? Where would the print /plot statement go ? On Thu, Aug 2, 2012 at 4:38 PM, Michael Weylandt wrote: > You need to explicitly print() the graphs to make them show -- or in > recent ggplot2 versions I think you can also use plot() as an alias. > > Michael > > On Aug 2,

Re: [R] ggplot does not show in knitr

2012-08-02 Thread Michael Weylandt
You need to explicitly print() the graphs to make them show -- or in recent ggplot2 versions I think you can also use plot() as an alias. Michael On Aug 2, 2012, at 2:37 PM, "firdaus.janoos" wrote: > Hello, > > I'm having some issues getting a ggplot figure to show up in the knitr > output,

[R] ggplot does not show in knitr

2012-08-02 Thread firdaus.janoos
Hello, I'm having some issues getting a ggplot figure to show up in the knitr output, when placed in a loop. Specifically, I have a loop inside a knitr chunk : ```{r fitting, warning=FALSE, fig.width=10, fig.height=10, fig.keep='high'} for (t in 1:T) { # do a regression of tgt.vals ~ predi