Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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")

fs

Cross-Platform File System Operations Based on 'libuv'

v1.5.0
GPL-3
Authors
Jim Hester [aut, cre], Hadley Wickham [aut], libuv project contributors [cph] (libuv library), Joyent, Inc. and other Node contributors [cph] (libuv library), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.