[RkWard-devel] Barplot plugin

I. Soumpasis nono.231 at gmail.com
Thu Jan 25 11:53:20 UTC 2007


2007/1/24, Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de
>:
>
> Hi!
>
> On Wednesday 24 January 2007 16:35, I. Soumpasis wrote:
> > I will uploaded at svn in some minutes. Also changed the plot.pluginmap
> > accordingly.What else should I change so the plugin to be installed?
> > Makefile or something?
>
> Yes, Makefile.am. Stefan has taken care of it already.
>
> > I made enough testings but please take a look and give advices and
> ideas.
>
> Some comments:
> - Try to avoid patterns like
>
> if (<? getRK ("something")?>) {
>         do.something.r ()
> }
>
> Rather write
>
> <? if (getRK_val ("something") == "TRUE") { ?>
> do.something.r ()
> <? } ?>


I tried something like this (for many hours) but in the code I get only the
first part of the code like the first if condition is always true. I send
the barplot2.php to take a look if I have done something wrong.

This way the generated code will not get convoluted with statements which
> are
> not acutally needed. See also
> http://rkward.sourceforge.net/documents/devel/plugins/phptemplate.html#policysimplicity
> .
>
> Something like (not tested for correctness):
>
> <?
> if (getRK_val ("beside") == "TRUE") {
> ?>rk.temp.barplot <- <?
> }
> ?>barplot((rk.temp.x)<? if (getRK_val ("rainbow")) { ?>,
> col=rainbow(rk.temp.x) } ?>, beside=<? getRK ("beside"); ?>, legend.text=
> <?
> getRK ("legend"); ?>,  ylim = range(rk.temp.x) * c(0, 1.2))
> <?
>
> if ((getRK_val ("beside") == "TRUE") && getRK_val ("labels")) { ?>
> text(rk.temp.barplot, rk.temp.x, labels=rk.temp.x, pos=<? getRK ("place");
> ?>,
> offset=.5)
> <? } ?>


That would be very nice and tried it in different ways and in this way too,
but with no result. The if (if getRK_val ("rainbow")) { ?>, col=rainbow(
rk.temp.x) <? } ?>, does not seem to work for me, because this part does not
appear in the code of the plug in, or appears constantly, whatever the
choice of the user.  Tried the code as is with a small differentiation here
l=rainbow( rk.temp.x) <? } ?> is in the barplot4.php.

- You might want to rewrite the first part as:
> rk.temp.x <- (<? echo ($vars); ?>)
> if(is.factor(rk.temp.x)) rk.temp.x=summary(rk.temp.x)
> else if (!is.matrix(rk.rempt.x)) error ("Only matrices or factors are
> supported")
>
> Saving one variable name, and also giving a more meaningful error message
> in
> case something wrong was selected.


I tried this, but I get a syntax error. The warnings points me to the .xml
file, so I removed the number type=numeric but with no result.

- in the cleanup function you could write to clear all symbols starting
> with " rk.temp" without listing each:
> rm (list=grep ("^rk.temp", ls (), value=TRUE))


This is very helpful.

- in the .xml, you might want to add the following to the logic section:
> <convert id="labelsvalue2" mode="and" sources="labelsvalue;labels.enabled"
> />
> and then change the next line to
> <connect client="place.enabled" governor="labelsvalue2" />


Thanks very much for this.  I will commit it to svn.

Otherwise, if the user first chooses to display labels, and after that sets
> the
> mode to stacked, the placement option will still remain enabled.
>
> Regards
> Thomas


"I don't think it's necessary in the help pages to state which settings are
the default."

I agree with this. Already removed the default references from .rkh page for
this plugin and I will do so for the others too. I will commit it to svn.

Finally, I made a change making one more variable rk.temp.barplot2 and moved
all the function to the function preprocess() as I had done in correlation
graph.

This leads me to one idea that it cross my mind. Could we write some
functions and embed them in the rkward package for R, so to use them in the
plugins like the Rcmdr package does?

Regards,
Ilias

-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> RKWard-devel mailing list
> RKWard-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rkward-devel
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070125/fcc78060/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: barplot2.php
Type: application/x-httpd-php
Size: 1367 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070125/fcc78060/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: barplot4.php
Type: application/x-httpd-php
Size: 1021 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070125/fcc78060/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: barplot.php
Type: application/x-httpd-php
Size: 1286 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070125/fcc78060/attachment-0002.bin>


More information about the Rkward-devel mailing list