keep_fnames {mclm} | R Documentation |
Filter collection of filenames by name
Description
The functions build a subset of an object of class fnames
based on a vector
of characters, either including them (with keep_fnames(invert = FALSE)
) or
excluding them (with keep_fnames(invert = FALSE)
or drop_fnames()
).
Usage
keep_fnames(x, y, invert = FALSE, ...)
drop_fnames(x, y, ...)
Arguments
x |
An object of class |
y |
An object of class |
invert |
Boolean value. If |
... |
Additional arguments. |
Value
An object of class fnames
.
Examples
all_fnames <- as_fnames(c("file1", "file2", "file3",
"file4", "file5", "file6"))
unwanted_fnames <- as_fnames(c("file1", "file4"))
keep_fnames(all_fnames, unwanted_fnames, invert = TRUE)
drop_fnames(all_fnames, unwanted_fnames)
wanted_fnames <- as_fnames(c("file3", "file5"))
keep_fnames(all_fnames, wanted_fnames)
[Package mclm version 0.2.7 Index]