choose_files: Choose Files

Description Usage Arguments Value Examples

View source: R/download_tools.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
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")

## End(Not run)

InteragencyEcologicalProgram/smonitr documentation built on Nov. 9, 2020, 7:01 a.m.