Title: | Java GUI for R |
---|---|
Description: | Java GUI for R - cross-platform, universal and unified Graphical User Interface for R. For full functionality on Windows and Mac OS X JGR requires a start application which depends on your OS. |
Authors: | Markus Helbig <[email protected]>, Simon Urbanek, Ian Fellows |
Maintainer: | Markus Helbig <[email protected]> |
License: | GPL-2 |
Version: | 1.9-2 |
Built: | 2024-11-10 06:17:54 UTC |
Source: | CRAN |
adds a new Menu to MenuBar in JGR Console
jgr.addMenu(name) jgr.insertMenu(name, index)
jgr.addMenu(name) jgr.insertMenu(name, index)
name |
Menu name |
index |
index at which to insert |
Menu
jgr.addMenuItem
jgr.addMenuSeparator
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')")
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')")
adds a new MenuItem to specified JGR Console Menu
jgr.addMenuItem(menu,name,command,silent=TRUE) jgr.insertMenuItem(menu,name,command,index,silent=TRUE)
jgr.addMenuItem(menu,name,command,silent=TRUE) jgr.insertMenuItem(menu,name,command,index,silent=TRUE)
menu |
Name of the menu that this item will be added to |
name |
Name of the menu item to add |
command |
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 |
MenuItem
jgr.addMenu
jgr.addMenuSeparator
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 )))
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 )))
adds a Separator to a Menu in JGR Console
jgr.addMenuSeparator(menu) jgr.insertMenuSeparator(menu,index)
jgr.addMenuSeparator(menu) jgr.insertMenuSeparator(menu,index)
menu |
name of the menu to add this separator to |
index |
index at which to insert |
Menu
jgr.addMenu("Workspace") jgr.addMenuItem("Workspace","Browse","ls()") jgr.addMenuSeparator("Workspace") jgr.addMenuItem("Workspace","Browse (pos=2)","ls(pos=2)")
jgr.addMenu("Workspace") jgr.addMenuItem("Workspace","Browse","ls()") jgr.addMenuSeparator("Workspace") jgr.addMenuItem("Workspace","Browse (pos=2)","ls(pos=2)")
adds a sub-menu to a Menu in JGR Console
jgr.addSubMenu(menu, subMenuName, labels, commands) jgr.insertSubMenu(menu, subMenuName, labels, commands,index)
jgr.addSubMenu(menu, subMenuName, labels, commands) jgr.insertSubMenu(menu, subMenuName, labels, commands,index)
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 |
Menu
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')"))
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')"))
returns the menu / menu item names
jgr.getMenuNames() jgr.getMenuItemNames(menu)
jgr.getMenuNames() jgr.getMenuItemNames(menu)
menu |
name of the menu |
a character vector
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')")
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')")
The following functions are publicly visible, but with the expection
of JGR
they should be only invoked from the GUI and not directly
by the user.
removes a menu / menu item
jgr.removeMenu(index) jgr.removeMenuItem(menu,index)
jgr.removeMenu(index) jgr.removeMenuItem(menu,index)
menu |
name of the menu |
index |
index of the item to remove |
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')")) jgr.removeMenuItem("added menu",1) jgr.removeMenu(length(jgr.getMenuNames()))
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')")) jgr.removeMenuItem("added menu",1) jgr.removeMenu(length(jgr.getMenuNames()))
The following functions are publicly visible, but with the expection
of JGR
they are usually invoked from the GUI and rarely
directly by the user.
JGR
can be used to update JGR including dependent packages or
to start JGR from within R. JGR is always started as an independent
application and the preferred way to start JGR is using launchers that
are provided from the JGR website http://www.rosuda.org
JGR(update = FALSE, javaArgs = NULL, jgrArgs = "") broken.gomp() installPackages(contriburl = NULL, type = getOption("pkgType")) jgr.pager(file, header, title, delete.file) jgr.browser(url, ...) jgr.set.options(..., useJavaGD = TRUE, useJGRpager = TRUE, useJGRbrowser = TRUE, useHTMLHelp = TRUE) object.browser() package.manager() reformat.code(txt)
JGR(update = FALSE, javaArgs = NULL, jgrArgs = "") broken.gomp() installPackages(contriburl = NULL, type = getOption("pkgType")) jgr.pager(file, header, title, delete.file) jgr.browser(url, ...) jgr.set.options(..., useJavaGD = TRUE, useJGRpager = TRUE, useJGRbrowser = TRUE, useHTMLHelp = TRUE) object.browser() package.manager() reformat.code(txt)
update |
If set to |
javaArgs |
Arguments for Java. |
jgrArgs |
Arguments passed to the main method of JGR. |
contriburl |
same as in |
type |
JGR uses the package type set in the R options |
file |
file to show |
header |
header for each file |
title |
overall title for the display |
delete.file |
should the files be deleted after display? Used for temporary files. |
url |
url to show |
useJavaGD |
if set to |
useJGRpager |
if set to |
useJGRbrowser |
if set to |
useHTMLHelp |
if set to |
... |
additional parameters or options to set |
txt |
R code to be made pretty |
Creates a new process launching the JGR Console
launchJGR(javaArgs=NULL,jgrArgs="",popMsgs=TRUE)
launchJGR(javaArgs=NULL,jgrArgs="",popMsgs=TRUE)
javaArgs |
Arguments for Java. |
jgrArgs |
Arguments passed to the main method of JGR. |
popMsgs |
If true, system pop-up messages are displayed if any errors are encountered. |
The system call for launching JGR