View source: R/file_handling.r
getfile | R Documentation |
getfile is a convenience function that serves as a wrapper for the functions
file.choose()
, file.path()
, and list.files()
.
If the user is working in a GUI environment, a window will pop up, allowing
the user to choose a specified file regardless of path.
getfile(multi = FALSE, pattern = NULL, combine = TRUE)
multi |
this is an indicator to allow the user to store the names of
multiple files found in the directory. This is useful in conjunction with
|
pattern |
a |
combine |
|
path |
a character string of the absolute path to the chosen file or files |
files |
a character vector containing the chosen file name or names. |
Zhian N. Kamvar
## Not run:
x <- getfile()
poppr(x$files)
y <- getfile(multi=TRUE, pattern="^.+?dat$")
#useful for reading in multiple FSTAT formatted files.
yfiles <- poppr.all(y$files)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.