Learn R Programming

JGR (version 1.9-2)

jgr.addMenu: New JGR Console Menu

Description

adds a new Menu to MenuBar in JGR Console

Usage

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

Value

Menu

Arguments

name

Menu name

index

index at which to insert

See Also

jgr.addMenuItem jgr.addMenuSeparator

Examples

Run this code
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')")

Run the code above in your browser using DataLab