Learn R Programming

fs (version 1.6.0)

path_filter: Filter paths

Description

Filter paths

Usage

path_filter(path, glob = NULL, regexp = NULL, invert = FALSE, ...)

Arguments

path

A character vector of one or more paths.

glob

A wildcard aka globbing pattern (e.g. *.csv) passed on to grep() to filter paths.

regexp

A regular expression (e.g. [.]csv$) passed on to grep() to filter paths.

invert

If TRUE return files which do not match

...

Additional arguments passed to grep.

Examples

Run this code
path_filter(c("foo", "boo", "bar"), glob = "*oo")
path_filter(c("foo", "boo", "bar"), glob = "*oo", invert = TRUE)

path_filter(c("foo", "boo", "bar"), regexp = "b.r")

Run the code above in your browser using DataLab