Learn R Programming

JGR (version 1.9-2)

jgr.addSubMenu: New JGR Console sub-menu

Description

adds a sub-menu to a Menu in JGR Console

Usage

jgr.addSubMenu(menu, subMenuName, labels, commands)
jgr.insertSubMenu(menu, subMenuName, labels, commands,index)

Value

Menu

Arguments

menu

name of the menu to add this sub-menu to

subMenuName

name of the sub-menu

labels

a character vector of menu items

commands

a character vector of commands to be exectued

index

index at which to insert

See Also

jgr.addMenu jgr.addMenuItem

Examples

Run this code
jgr.addMenu("added menu")
jgr.addMenuItem("added menu", "print 1","print(1)")
jgr.insertMenuItem("added menu","print 1 as if entered in console","print(1)",1,FALSE)
jgr.addMenuSeparator("added menu")
jgr.addSubMenu("added menu","sub menu",c("a","b","c"),c("print('a')","print('b')","print('c')"))

Run the code above in your browser using DataLab