Learn R Programming

mclm (version 0.2.7)

merge_fnames: Merge filenames collections

Description

These functions merge two or more fnames objects into one larger fnames object, removing duplicates (keeping only the first appearance) and only resorting the items if sort = TRUE.

Usage

fnames_merge(x, y, sort = FALSE)

fnames_merge_all(..., sort = FALSE)

Value

An object of class fnames.

Arguments

x, y

An object of class fnames.

sort

Boolean value. Should the items in the output be sorted?

...

Various objects of class fnames or a list of objects of class fnames.

Examples

Run this code
cwd_fnames <- as_fnames(c("file1.txt", "file2.txt"))
cwd_fnames2 <- as_fnames(c("dir1/file3.txt", "dir1/file4.txt"))
cwd_fnames3 <- as_fnames(c("dir2/file5.txt", "dir2/file6.txt"))
fnames_merge(cwd_fnames, cwd_fnames2)
fnames_merge_all(cwd_fnames, cwd_fnames2, cwd_fnames3)

Run the code above in your browser using DataLab