Last data update: 2014.03.03

R: New JGR Console Menu
jgr.addMenuR Documentation

New JGR Console Menu

Description

adds a new Menu to MenuBar in JGR Console

Usage

jgr.addMenu(name)
jgr.insertMenu(name, index)

Arguments

name

Menu name

index

index at which to insert

Value

Menu

See Also

jgr.addMenuItem jgr.addMenuSeparator

Examples

jgr.addMenu("Workspace")
jgr.addMenuItem("Workspace","Browse","ls()")
jgr.addMenuSeparator("Workspace")
jgr.addMenuItem("Workspace","Browse (pos=2)","ls(pos=2)")


menus <- jgr.getMenuNames()
index <- which(menus=="Packages & Data")
if(length(index)==0) index <- 1

jgr.insertMenu("User menu", index)
jgr.addMenuItem("User menu", "Good place for user generated menus is",
                "print('before Packages & Data')")

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.addMenu.Rd_%03d_medium.png", width=480, height=480)
> ### Name: jgr.addMenu
> ### Title: New JGR Console Menu
> ### Aliases: jgr.addMenu jgr.insertMenu
> ### Keywords: programming
> 
> ### ** Examples
> 
> jgr.addMenu("Workspace")
jgr.addMenu() cannot be used outside JGR.
> jgr.addMenuItem("Workspace","Browse","ls()")
jgr.addMenuItem() cannot be used outside JGR.
> jgr.addMenuSeparator("Workspace")
jgr.addMenuSeparator() cannot be used outside JGR.
> jgr.addMenuItem("Workspace","Browse (pos=2)","ls(pos=2)")
jgr.addMenuItem() cannot be used outside JGR.
> 
> 
> menus <- jgr.getMenuNames()
jgr.getMenuNames() cannot be used outside JGR.
> index <- which(menus=="Packages & Data")
> if(length(index)==0) index <- 1
> 
> jgr.insertMenu("User menu", index)
jgr.insertMenu() cannot be used outside JGR.
> jgr.addMenuItem("User menu", "Good place for user generated menus is",
+                 "print('before Packages & Data')")
jgr.addMenuItem() cannot be used outside JGR.
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>