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 |
|
a character string of the absolute path to the chosen file or files
a character vector containing the chosen file name or names.
#> Warning: input string 1 is invalid in this locale#> Error in if (toupper(.readExt(x)) == "CSV") { try(input <- read.genalex(x), silent = quiet) try(input <- read.genalex(x, region = TRUE), silent = quiet) try(input <- read.genalex(x, geo = TRUE), silent = quiet) try(input <- read.genalex(x, geo = TRUE, region = TRUE), silent = quiet)} else { try(input <- import2genind(x, quiet = quiet), silent = quiet)}: missing value where TRUE/FALSE neededy <- getfile(multi=TRUE, pattern="^.+?dat$")#> Error in file.choose(): file choice cancelled#> Error in seq(length(filelist)): object 'y' not found# }