tk.utils | R Documentation |
These functions are components used to build interactive interfaces.
tk.file
is a wrapper to tcltk functions tkgetOpenFile
and tkgetOpenFile
with several enhancements.
tk.files
proposes to build and order a file list from multiple calls to tk.file
.
tk.folder
is a wrapper to tcltk function tkchooseDirectory
with small enhancements.
handle
is a wrapper to withRestarts
, which allows to catch errors, warnings and messages while executing an R expression and handle them with custom functions.
tk.file(title = "Choose a file", typeNames = "All files", typeExt = "*",
multiple = FALSE, mandatory = TRUE, type = c("open", "save"), initialdir = NULL,
parent = NULL)
tk.files(preselection = character(0), multiple = TRUE, parent = NULL, ...)
tk.folder(title = "Choose a directory", mustexist = TRUE, mandatory = TRUE)
handle(expr, messageHandler, warningHandler, errorHandler)
title |
Single character value, the displayed name of the summoned window. |
typeNames |
Character vector defining the displayed names of the filtered file extensions. Parallel to |
typeExt |
Character vector defining the filtered file extensions (use "*" as wildcard). Parallel to |
multiple |
Single logical value, whether to allow multiple file selection or not. |
mandatory |
Single logical value, whether to throw an error if no file is selected or not. |
type |
Single character value defining the label of the button. |
initialdir |
Single character value, the initially selected directory when the window is summoned. |
parent |
A Tcl-Tk object to consider as the parent of the new frame. |
preselection |
Character vector, the files already selected when the window is summoned. |
... |
Further arguments to be passed to |
mustexist |
Single logical value, whether to throw an error if a non-existing directory is selected or not. |
expr |
An R expression in which errors, warnings and messages are to be caught. Use |
messageHandler |
A function taking as single argument the condition object caught. If missing, messages will pass through. |
warningHandler |
A function taking as single argument the condition object caught. If missing, warnings will pass through. |
errorHandler |
A function taking as single argument the condition object caught. If missing, errors will pass through. |
tk.file
, tk.files
and tk.folder
return the selection as a character vector, possibly empty.
handle
returns nothing.
Sylvain Mareschal
tk.browse
, tk.convert
, tk.tracks
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.