'Python'
Choose a directory, one or multiple files to open, or choose a file to save.
choose_fileopen(
initialfile = NULL,
multiple = FALSE,
title = ifelse(multiple, "Choose Files", "Choose a File"),
message = "",
verbose = FALSE,
force = FALSE
)choose_filesave()
choose_directory(
initialdir = NULL,
title = "Choose a Directory",
message = "",
verbose = FALSE
)
User-selected paths. If the users select nothing, then NULL
will be returned. For multiple file selection, multiple paths will be returned.
initial selection of file or directory
whether to open multiple files
dialogue title and message
whether to verbose debug information
whether to force using 'Python'
when native R
functions are available, default is false
Base-R has file.choose
function to choose files. However,
users cannot select multiple files nor directories. These functions fill
the gap by using 'Python'
'tkinter'
package. Please make
sure that one-time setup function configure_conda
has executed
before running these functions.
The functions must run as interactive mode. If you run the functions on a server, most likely you will get nothing. The functions themselves do not check if you are running under interactive sessions. You must check by yourself.
if(interactive()) {
choose_fileopen(multiple = TRUE)
}
Run the code above in your browser using DataLab