r - file.choose() customizing dialogue window
An alternative:
library(tcltk)
X <- read.csv(tk_choose.files(caption = "Choose X"))
See that the function can also be used to select multiple files in one call. For that, hold CTRL when selecting more than one file:
XYZ.list <- lapply(tk_choose.files(caption = "Choose X, Y, and Z"), read.csv)
but the selection order is not preserved so you might want to keep three separate calls if that works better for you.
On Windows, you can use choose.files
, which allows for custom title and also default file name (default
), file type filtering (filters
) and multifile selection (multi
):
choose.files(default = "", caption = "Select files",
multi = TRUE, filters = Filters,
index = nrow(Filters))
check the help ?choose.files
;)