rk.JS.array | R Documentation |
If you need to combine multiple options (like values of several checkboxes) into one vector or list, this function can help with that task. All relevant variables will become part of an array and then joined into the desired argument type.
rk.JS.array( option, variables = list(), funct = "c", var.prefix = NULL, quote = FALSE, opt.sep = ", " )
option |
A character string, naming, e.g., an option of an R function which should be constructed from several variables. |
variables |
A list with either character strings (the names of the variables to combine to a vector or list),
or objects of class |
funct |
Character string, name of the R function to be called to combine the options,
e.g. "list" for |
var.prefix |
A character string. sets a global string to be used as a prefix for the JS variable names. |
quote |
Logical, if |
opt.sep |
Character string, will be printed in the resulting R code before the option name. |
An object of class rk.JS.arr
.
rk.paste.JS
,
rk.JS.options
,
rk.JS.vars
,
echo
,
id
,
and the Introduction to Writing Plugins for RKWard
# create three checkboxes for independent options checkA <- rk.XML.cbox(label="Run Test A", value="A") checkB <- rk.XML.cbox(label="Run Test B", value="B") checkC <- rk.XML.cbox(label="Run Test C", value="C") # combine them into one list of options via JavaScript rk.JS.array("run.tests", variables=list(checkA, checkB, checkC), funct="list")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.