"End"
button
is pressed, the function returns a vector of character strings with
the full paths of the selected files.
fileBrowser(path="", testFun = function(x) TRUE, prefix = NULL,
suffix = NULL, textToShow = "Select file(s)",
nSelect = -1)
nSelect = -1
as per default."/"
for Unix systems).Single click on a file name will make the file selectable when the select button is pressed. Multiple selection is possible by dragging with mouse button 1 pressed.
Double click on a directory name will go into that directory and display its files. When a file/directory is selected and the "End" button pressed, the full path for the selected files selected will be returned.
The widget is modal and has to be closed by pressing the "End" button
before doing any other operations. Functions, prefix, and suffix can
be specified. Examples of validity functions are
hasPrefix
and hasSuffix
.
The following is a list of the buttons and their associated behavior:
Up
Select \>\>
\<\< remove<="" code="">\<>
Clear
end
NULL
if the box is empty. The full path
will be appended to the file names.
pickFiles
,
hasPrefix
, hasSuffix
## The example here is only run interactively since it requires user
## interference which may cause problems if not available:
if(interactive()) {
# Call the function to view the current directory
flist <- fileBrowser()
flist
# To call the function with a path do
# fileBrowser(path = "yourPath")
}
Run the code above in your browser using DataLab