Subset a list of files based on filenames or regex strings.

choose_files(files, selections = ".*", verbose = FALSE)

Arguments

files

A vector of file names.

selections

A vector of file names to choose from files. Supports regex.

verbose

If TRUE, display descriptive message.

Value

A vector of file names.

Examples

if (FALSE) { file.list = parse_ftp_index("ftp://ftp.dfg.ca.gov/IEP_Zooplankton") choose_files(file.list, c("CBMatrix", "MysidMatrix")) # can also be used to select sheets in an excel file f = download_file(paste0("https://github.com/", "InteragencyEcologicalProgram/Status-and-Trends/blob/", "9d1ba8ec3f475e96dbdd7788b45c26fb0fc55b0b/data/", "EMPMysidBPUEMatrixAug2019.xlsx?raw=true"), "temp.xlsx") sheets = readxl::excel_sheets(f) choose_files(sheets, "Mysid") }