<br><br><div><span class="gmail_quote">2007/1/25, Thomas Friedrichsmeier <<a href="mailto:thomas.friedrichsmeier@ruhr-uni-bochum.de">thomas.friedrichsmeier@ruhr-uni-bochum.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 25 January 2007 12:53, you wrote:<br>> That would be very nice and tried it in different ways and in this way too,<br>> but with no result. The if (if getRK_val ("rainbow")) { ?>, col=rainbow(
<br>> rk.temp.x) <? } ?>, does not seem to work for me, because this part does<br>> not appear in the code of the plug in, or appears constantly, whatever the<br>> choice of the user.  Tried the code as is with a small differentiation here
<br>> l=rainbow( rk.temp.x) <? } ?> is in the barplot4.php.<br><br>Ok, small correction: Instead of<br>        if (getRK_val ("rainbow")) ...<br>you'd have to write<br>        if (getRK_val ("rainbow") == "TRUE") ...
<br>either that or change the value and value_unchecked of the rainbow checkbox<br>to "1" and "0". Why? Well, PHP works slightly different from R. If it sees<br>the string "FALSE", it will not recognize this as the logical false. Rather
<br>it will see "Ok, this is a non-zero string, I can't convert it to a number,<br>so I'll take the condition as fulfilled". In other words, here's what it<br>looks like in PHP, when the getRK_val () statement has been evaluated:
<br><br>if ("TRUE") {<br>        // this gets executed / shown<br>}<br>if ("FALSE") {<br>        // this also gets executed / shown!<br>}<br>if ("0") {<br>        // this does not get executed
<br>}<br>if ("FALSE" == "TRUE") {<br>        // this does not get executed<br>}<br><br>Does it make sense, now?</blockquote><div><br>Yes! too much! So I managed to make using php. Looks much better. Found a book on php, so I will take a look in the next days to learn the basics.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> - You might want to rewrite the first part as:<br>> > rk.temp.x <- (<? echo ($vars); ?>)
<br>> > if(is.factor(rk.temp.x)) rk.temp.x=summary(rk.temp.x)<br>> > else if (!is.matrix(rk.rempt.x)) error ("Only matrices or factors are<br>> > supported")<br>> ><br>> > Saving one variable name, and also giving a more meaningful error message
<br>> > in<br>> > case something wrong was selected.<br>><br>> I tried this, but I get a syntax error. The warnings points me to the .xml<br>> file, so I removed the number type=numeric but with no result.
<br><br>A typo, somewhere?</blockquote><div><br>The problem is with the else if part. I removed and it works fine. I can not understand what is the problem. I tried it on R and works. But in the script does not work. So I removed it for now. Also the variable could be a vector, so it must not give an error message if it is not a matrix. 
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Finally, I made a change making one more variable rk.temp.barplot2 and<br>
> moved all the function to the function preprocess() as I had done in<br>> correlation graph.<br><br>Not quite sure, whether it make much sense in this case. After all, in essence<br>it's a really thin wrapper around barplot, and does not provide too much
<br>additional functionality (ok, one additional statement for the value labels,<br>but I don't think that justifies a function).<br>However, let's try to get the PHP ifs right, first, then we can worry about<br>this detail later.
<br><br>> This leads me to one idea that it cross my mind. Could we write some<br>> functions and embed them in the rkward package for R, so to use them in the<br>> plugins like the Rcmdr package does?<br><br>It depends. Yes, if it's a function that is
<br>1) used by many or all plugins and<br>2) does not hide any essentials, i.e. only does some printing / formatting,<br>but does not actually calculate a result / perform a statistic function<br><br>No, if it's a function that is
<br>1) useful to only two or three plugins or<br>2) hides some essential steps of what is being done.<br><br>The reasons are<br>a) Keep the rkward package lean an mean. If we would - in the extreme - add<br>one function for each plugin, that would mean plugins are no longer modular,
<br>are no longer easy to install (you'd always have to update the rkward package<br>as well), and the rkward package would become huge, while only little<br>functionality is actually used in a typical session.<br>b) Keep compatible in the essentials. The core of all generated code should
<br>also be runnable without the rkward package installed (so users can share<br>code snippets with other R users that cannot or do not want to use RKWard).<br>RKWard may provide some icing on the cake by e.g. making sure the results are
<br>printed in a consistent look across all plugins, but it should not actually<br>provide statistics functions. Those are better kept in the regular add-on<br>packages on CRAN.<br>If we do feel a real need for that, we should provide a stand-alone add-on
<br>package for inclusion on CRAN, or try to get the function(s) included in<br>existing packages on CRAN.<br>c) Don't hide what's going on. The generated code should be as simple as<br>possible, but not to the point of hiding everything in a function. Then - if
<br>users would like to modify some aspect - they'd have to start modifying those<br>functions, instead of just copy-and-pasting some snippets from here to there.<br><br>Well, this is not set in stone, but that's the way I see it.
<br><br>Regards<br>Thomas<br><br><br>-------------------------------------------------------------------------<br>Take Surveys. Earn Cash. Influence the Future of IT<br>Join SourceForge.net's Techsay panel and you'll get the chance to share your
<br>opinions on IT & business topics through brief surveys - and earn cash<br><a href="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV">http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
</a><br><br>_______________________________________________<br>RKWard-devel mailing list<br><a href="mailto:RKWard-devel@lists.sourceforge.net">RKWard-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/rkward-devel">
https://lists.sourceforge.net/lists/listinfo/rkward-devel</a><br><br><br><br></blockquote></div><br>