cmd_file_expect: Creates list of paths by file extension & checks they exist

Description Usage Arguments Details Value Examples

Description

Ext or prefix can be a vector or single character. The shorter value will be propagated across all values of the other. See Examples for details.

Usage

1
cmd_file_expect(prefix, ext, outdir = ".")

Arguments

prefix

name of file prefix for each extension.

ext

vector of file extensions

outdir

directory the files will be inside

Details

If files are not found, throws an error

Value

vector of valid file paths

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Expects many file types of same prefix
# ie myFile.txt, myFile.html, myFile.xml
cmd_file_expect("myFile", c("txt", "html", "xml"))

# Expects many files of same type
# ie myFile1.txt, myFile2.txt, myFile3.txt
cmd_file_expect(c("myFile1", "myFile2", "myFile3"), "txt")

# Expects many files with each prefix and each extension
# ie myFile1.txt, myFile1.html, myFile2.txt, myFile2.html
cmd_file_expect(c("myFile1", "myFile2"), c("txt", "html"))


## End(Not run)

snystrom/dotargs documentation built on Oct. 18, 2020, 8:39 a.m.