Title: | 'rChoiceDialogs' Collection |
---|---|
Description: | Collection of portable choice dialog widgets. |
Authors: | Alex Lisovich [aut, cre], Roger Day [aut], Sun Microsystems, Inc [cph] (swing-layout-1.0.4.jar, download from http://www.java2s.com/Code/Jar/s/Downloadswinglayout104jar.htm) |
Maintainer: | Alex Lisovich <[email protected]> |
License: | LGPL (>= 2.1) |
Version: | 1.0.6.1 |
Built: | 2024-11-22 06:30:43 UTC |
Source: | CRAN |
Package: | rChoiceDialogs |
Type: | Package |
Version: | 1.0.4 |
Date: | 2012-10-11 |
License: | GPL (>= 2) |
LazyLoad: | yes |
Alex Lisovich, Roger Day
Check if Java graphics can be used
canUseJava()
canUseJava()
TRUE if Java graphics can be used and FALSE otherwise.
Alex Lisovich, Roger Day
Check if modal Java dialogs can be used
canUseJavaModal()
canUseJavaModal()
TRUE if modal Java dialogs can be used and FALSE otherwise.
Alex Lisovich, Roger Day
Check if Tcl/Tk graphics can be used
canUseTclTk()
canUseTclTk()
TRUE if Tcl/Tk graphics can be used and FALSE otherwise.
Alex Lisovich, Roger Day
Allows to choose files or directories using the using the command line based interaction providing the same functionality as GUI counterparts without using any graphical framework.
cmdchoose.files(default = getwd(), caption = "Select files", multi = TRUE, dir.only = FALSE, filters = getDefaultFilters(), index = nrow(filters))
cmdchoose.files(default = getwd(), caption = "Select files", multi = TRUE, dir.only = FALSE, filters = getDefaultFilters(), index = nrow(filters))
default |
Which filename or directory to show initially. Default is current work directory. |
caption |
The caption on the file selection dialog |
multi |
Whether to allow multiple files to be selected |
dir.only |
If TRUE (default is FALSE) works as directory chooser. |
filters |
A matrix of filename filters. If NULL, all files are shown. Default is filters=getDefaultFilters(). |
index |
Which row of filters to use by default. |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
cmdchoose.files() is called internally by rchoose.files() if neither Java nor TclTk are available Calling cmdchoose.files() directly forces the package to use command line interaction regardless of system capabilities and therefore may fail. Use the direct call to cmdchoose.files() only if it seems beneficial to bypass the rchoose.files() decision logic.
Alex Lisovich, Roger Day
getDefaultFilters
,
rchoose.files
,
canUseJavaModal
## Not run: cmdchoose.files(); ## End(Not run)
## Not run: cmdchoose.files(); ## End(Not run)
Get default set of filters
getDefaultFilters()
getDefaultFilters()
Default set of filters for jchoose.files
Alex Lisovich, Roger Day
jchoose.files
,
tkchoose.files
,
rchoose.files
Provides the same functionality as choose.dir from utils package, but relies on Java and rJava package and therefore is system independent provided Java 1.5 and higher is installed.
jchoose.dir(default = getwd(), caption = "Select Directory", modal = canUseJavaModal())
jchoose.dir(default = getwd(), caption = "Select Directory", modal = canUseJavaModal())
default |
Which filename or directory to show initially. Default is current work directory. |
caption |
The caption on the file selection dialog |
modal |
Indicates how the modality of the dialog is implemented. If TRUE, the modal dialog is used and if FALSE, R repeatedly checks for dialog status (active or not). The latter is used to refresh R Gui window on Windows. Default is canUseJavaModal(). |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
jchoose.dir() is called internally by rchoose.dir() if it's appropriate for a given platform/graphics combination. Calling jchoose.dir() directly forces the package to use Java based dialog regardless of system capabilities and therefore may fail. Use the direct call to jchoose.dir() only if it seems beneficial to bypass the rchoose.dir() decision logic.
Alex Lisovich, Roger Day
## Not run: jchoose.dir(); ## End(Not run)
## Not run: jchoose.dir(); ## End(Not run)
Provides the same functionality as choose.files from utils package, but relies on Java and rJava package and therefore is system independent provided Java 1.5 and higher is installed.
jchoose.files(default = getwd(), caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters), modal = canUseJavaModal())
jchoose.files(default = getwd(), caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters), modal = canUseJavaModal())
default |
Which filename or directory to show initially. Default is current work directory. |
caption |
The caption on the file selection dialog |
multi |
Whether to allow multiple files to be selected |
filters |
A matrix of filename filters. If NULL, all files are shown. Default is filters=getDefaultFilters(). |
index |
Which row of filters to use by default. |
modal |
Indicates how the modality of the dialog is implemented. If TRUE, the modal dialog is used and if FALSE, R repeatedly checks for dialog status (active or not). The latter is used to refresh R Gui window on Windows. Default is canUseJavaModal(). |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
jchoose.files() is called internally by rchoose.files() if it's appropriate for a given platform/graphics combination. Calling jchoose.files() directly forces the package to use Java based dialog regardless of system capabilities and therefore may fail. Use the direct call to jchoose.files() only if it seems beneficial to bypass the rchoose.files() decision logic.
Alex Lisovich, Roger Day
getDefaultFilters
,
rchoose.files
,
canUseJavaModal
## Not run: jchoose.files(); ## End(Not run)
## Not run: jchoose.files(); ## End(Not run)
Provides the same functionality as choose.files from utils package, but relies on Java and rJava package and therefore is system independent provided Java 1.5 and higher is installed. This brings up a modal dialog box with a (scrollable) list of items, which can be selected by the mouse. If multiple is true, further items can be selected or deselected by holding the control key down whilst selecting, and shift-clicking can be used to select ranges. Normal termination is via the 'OK' button or by hitting Enter or double-clicking an item. Selection can be aborted via the 'Cancel' button or pressing Escape. If no graphical widget is available it displays a text list from which the user can choose by number(s). The multiple = FALSE case uses menu. Preselection is only supported for multiple = TRUE, where it is indicated by a '+' preceding the item. It is an error to use select.list in a non-interactive session.
jselect.list(choices, preselect = NULL, multiple = FALSE, title = NULL, modal = canUseJavaModal())
jselect.list(choices, preselect = NULL, multiple = FALSE, title = NULL, modal = canUseJavaModal())
choices |
A character vector of items. |
preselect |
A character vector, or NULL. If non-null and if the string(s) appear in the list, the item(s) are selected initially. |
multiple |
Logical: can more than one item be selected? |
title |
Optional character string for window title, or NULL for no title. |
modal |
Indicates how the modality of the dialog is implemented. return A character vector of selected items. If multiple is false and no item was selected (or Cancel was used), ” is returned. If multiple is true and no item was selected (or Cancel was used) then a character vector of length 0 is returned. |
jselect.list() is called internally by rchoose.list() if it's appropriate for a given platform/graphics combination. Calling jselect.list() directly forces the package to use Java based dialog regardless of system capabilities and therefore may fail. Use the direct call to jselect.list() only if it seems beneficial to bypass the rchoose.list() decision logic.
Alex Lisovich, Roger Day
## Not run: jselect.list(c("Peter", "Alex", "Roger", "Leah"),title="Select", multiple=TRUE); ## End(Not run)
## Not run: jselect.list(c("Peter", "Alex", "Roger", "Leah"),title="Select", multiple=TRUE); ## End(Not run)
Provides the same functionality as choose.dir from the utils package for Windows, but is intended to be system independent.
rchoose.dir(default = getwd(), caption = "Select Directory")
rchoose.dir(default = getwd(), caption = "Select Directory")
default |
Which filename or directory to show initially. Default is current work directory. |
caption |
The caption on the file selection dialog |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
Alex Lisovich, Roger Day
getDefaultFilters
,
jchoose.files
,
tkchoose.files
, canUseJava
,
canUseTclTk
## Not run: rchoose.dir(); ## End(Not run)
## Not run: rchoose.dir(); ## End(Not run)
Provides the same functionality as choose.files from the utils package for Windows, but is intended to be system independent.
rchoose.files(default = getwd(), caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters))
rchoose.files(default = getwd(), caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters))
default |
Which filename or directory to show initially. Default is current work directory. |
caption |
The caption on the file selection dialog |
multi |
Whether to allow multiple files to be selected |
filters |
A matrix of filename filters. If NULL, all files are shown. Default is filters=getDefaultFilters(). |
index |
Which row of filters to use by default. |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
Alex Lisovich, Roger Day
getDefaultFilters
,
jchoose.files
,
tkchoose.files
, canUseJava
,
canUseTclTk
## Not run: rchoose.files(); ## End(Not run)
## Not run: rchoose.files(); ## End(Not run)
Provides the same functionality as select.list from the utils package, but is intended to broaden the range of systems where selection can be made through the graphical dialog provided Java 1.5 or higher is installed. This brings up a modal dialog box with a (scrollable) list of items, which can be selected by the mouse. If multiple is true, further items can be selected or deselected by holding the control key down whilst selecting, and shift-clicking can be used to select ranges. Normal termination is via the 'OK' button or by hitting Enter or double-clicking an item. Selection can be aborted via the 'Cancel' button or pressing Escape. If no graphical widget is available it displays a text list from which the user can choose by number(s). The multiple = FALSE case uses menu. Preselection is only supported for multiple = TRUE, where it is indicated by a '+' preceding the item. It is an error to use rselect.list in a non-interactive session.
rselect.list(choices, preselect = NULL, multiple = FALSE, title = NULL, graphics = getOption("menu.graphics"))
rselect.list(choices, preselect = NULL, multiple = FALSE, title = NULL, graphics = getOption("menu.graphics"))
choices |
A character vector of items. |
preselect |
A character vector, or NULL. If non-null and if the string(s) appear in the list, the item(s) are selected initially. |
multiple |
Logical: can more than one item be selected? |
title |
Optional character string for window title, or NULL for no title. |
graphics |
logical indicating if a graphical widget should be used. return A character vector of selected items. If multiple is false and no item was selected (or Cancel was used), ” is returned. If multiple is true and no item was selected (or Cancel was used) then a character vector of length 0 is returned. |
Alex Lisovich, Roger Day
## Not run: rselect.list(c("Peter", "Alex", "Roger", "Leah"),title="Select", multiple=TRUE); ## End(Not run)
## Not run: rselect.list(c("Peter", "Alex", "Roger", "Leah"),title="Select", multiple=TRUE); ## End(Not run)
Provides the same functionality as choose.files from utils package for Windows, but relies on tcltk package and therefore is system independent provided tcltk is installed.
tkchoose.files(default = "", caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters))
tkchoose.files(default = "", caption = "Select files", multi = TRUE, filters = getDefaultFilters(), index = nrow(filters))
default |
Which filename to show initially |
caption |
The caption on the file selection dialog |
multi |
Whether to allow multiple files to be selected |
filters |
A matrix of filename filters. If NULL, all files are shown. Default is filters=getDefaultFilters(). |
index |
Which row of filters to use by default. |
A character vector giving zero or more file paths. If user cancels operation, character(0) is returned.
tkchoose.files() is called internally by rchoose.files() if it's appropriate for a given platform/graphics combination. Calling tkchoose.files() directly forces the package to use tcl tk based dialog regardless of system capabilities and therefore may fail. Use the direct call to tkchoose.files() only if it seems beneficial to bypass the rchoose.files() decision logic.
Alex Lisovich, Roger Day
getDefaultFilters
,
rchoose.files
## Not run: tkchoose.files(); ## End(Not run)
## Not run: tkchoose.files(); ## End(Not run)