[rkward-devel] moved packages & added JA generating functions

meik michalke meik.michalke at uni-duesseldorf.de
Sun Oct 2 22:41:23 UTC 2011


hi,

i've moved rkwarddev and XiMpLe into a new folder at root level, "packages", 
as you suggested (svn move threw me an error, i had to re-add the files, hope 
nothing got lost there).

also, rkwarddev gained some quite experimental stuff to generate JavaScript 
code with R. as said before i mostly wanted to be able to use the XML objects 
and have them replaced with their ID in the code, which is basically working 
now with a function i called id():

 # first create an example checkbox XML node
 cbox1 <- rk.XML.cbox(label="foo", value="foo1", id.name="CheckboxFoo.ID")

 # some useless demonstration of id()
 id("cbox1 has the ID ", cbox1, "!")
 # returns: "cbox1 has the ID CheckboxFoo.ID!"
 cat(id("cbox1 has the ID ", cbox1, "!", quote=TRUE, collapse=" + "))
 # returns: "cbox1 has the ID " + CheckboxFoo.ID + "!"

so this can be used to paste() together anything manually. but i also 
implemented two very common cases for convenience:

 echo("bla <- \"", cbox1, "\"")
 # with cat() generates:
 #   echo("bla <- \"" + CheckboxFoo.ID + "\"");
 # so echo() creates a JS clone of itself...

 ite(id(cbox1), echo("bar <- \"", cbox1, "\""), echo("bar <- NULL"))
 # ite is just short for if/then/else, so this produces:
 # if(CheckboxFoo.ID) {
 #     echo("bar <- \"" + CheckboxFoo.ID + "\"");
 # } else {
 #     echo("bar <- NULL");
 # }


viele grüße :: m.eik

-- 
dipl. psych. meik michalke
institut f"ur experimentelle psychologie
abt. f"ur diagnostik und differentielle psychologie
heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20111003/57be4eb8/attachment.sig>


More information about the Rkward-devel mailing list