Description Usage Arguments Details Value
This is a convenient wrapper to select one file in the directory path
from multiple files matching pattern
.
1 2 3 4 5 6 7 8 9 | select_single_file(
path = getwd(),
prefix = ".+",
suffix = "*",
pattern = NULL,
filetype = "file",
caption = "Select a",
label = "Select"
)
|
path |
A character vector of file paths; the default corresponds to the
working directory, |
prefix |
A regular expression to match the filename (without extension). |
suffix |
A character to match the file extension, e.g. "csv". |
pattern |
A regular expression. Only file names which match the regular expression will be returned. |
filetype |
A human-readable file type designation. Along with |
caption |
The window title. |
label |
The label to use for the 'Accept' / 'OK' button. |
In case multiple files are found, the user is prompted to choose one option or none.
If pattern
is not NULL
, prefix
and suffix
will be
ignored.
prefix
is ignored when the RStudio API is used.
A character vector with a single element in case a single file matches pattern
or a single choice was made, else an empty character vector.
In a non-interactive session, returns an empty character vector and a warning if multiple files were found.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.