R expression(s) as a string to be parsed and evaluated or a function that will be called (without arguments) when the menu item is selected
index
index at which to insert
silent
If FALSE, executes as if entered into the cons
Value
MenuItem
See Also
jgr.addMenujgr.addMenuSeparator
Examples
jgr.addMenu("Workspace")
jgr.addMenuItem("Workspace","Browse","ls()",FALSE)
jgr.addMenuSeparator("Workspace")
jgr.addMenuItem("Workspace","List Functions",
function() unlist(lapply(ls(envir=.GlobalEnv),
function(x) if (is.function(get(x))) x else NULL )))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(JGR)
Loading required package: rJava
Loading required package: JavaGD
Loading required package: iplots
Please type JGR() to launch console. Platform specific launchers (.exe and .app) can also be obtained at http://www.rforge.net/JGR/files/.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/JGR/jgr.addMenuItem.Rd_%03d_medium.png", width=480, height=480)
> ### Name: jgr.addMenuItem
> ### Title: New JGR Console MenuItem
> ### Aliases: jgr.addMenuItem jgr.insertMenuItem
> ### Keywords: programming
>
> ### ** Examples
>
> jgr.addMenu("Workspace")
jgr.addMenu() cannot be used outside JGR.
> jgr.addMenuItem("Workspace","Browse","ls()",FALSE)
jgr.addMenuItem() cannot be used outside JGR.
> jgr.addMenuSeparator("Workspace")
jgr.addMenuSeparator() cannot be used outside JGR.
> jgr.addMenuItem("Workspace","List Functions",
+ function() unlist(lapply(ls(envir=.GlobalEnv),
+ function(x) if (is.function(get(x))) x else NULL )))
jgr.addMenuItem() cannot be used outside JGR.
>
>
>
>
>
> dev.off()
null device
1
>