Hi!

On Monday 17 June 2013 15:07:32 SANCHEZ ALBERCA, ALFREDO wrote:
> I have a RKWard plugin that plot some graphics and I wan to update it to use
> ggplot2. When I use the plot function I get the graphics without problems,
> but when I use the qplot function of package ggplot2, I get nothing.
> However, it works when I use the command line.
> Has anybody tried ggplot2 with RKWard?

As Meik has pointed out, some example lines of (generated) code would be 
useful. But as a first guess, the gotcha is auto-printing:

ggplot2 functions, in contrast to "regular" plotting functions, do not 
actually "have the side-effect" of creating a plot, but rather they create an 
object, that - when printed - creates a plot. When running code on the top-
level, line by line, values get auto-printed. But once you leave the top-level 
(as does all plugin code), the difference becomes visible. Consider these 
examples:

{ qplot(mpg, wt, data=mtcars); 1 }
{ x <- qplot(mpg, wt, data=mtcars); 1; x }
{ print(qplot(mpg, wt, data=mtcars)); 1 }

The third example should point to the correct solution: Call print(), 
explicitly, to make the plot show up.

Regards
Thomas

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel

Reply via email to