starts_with_parts: Do Subfolder List Elements Start with Given Folder Names?

Description Usage Arguments Value Examples

View source: R/utils_path.R

Description

Do Subfolder List Elements Start with Given Folder Names?

Usage

1
starts_with_parts(parts, elements)

Arguments

parts

list of list of character as returned by split_paths or a matrix of character representing the subfolder names at the different folder depths as returned by to_subdir_matrix.

elements

vector of character giving the sequence of strings to be found in parts

Value

vector of logical as long as parts containing TRUE at positions i for which all(parts[[i]][seq_along(elements)] == elements) is TRUE

Examples

1
2
3
4
5
6
7
parts <- strsplit(c("a/b/c", "a/b/d", "b/c"), "/")
starts_with_parts(parts, elements = c("a", "b"))
starts_with_parts(parts, elements = c("b", "c"))

subdir_matrix <- kwb.file::to_subdir_matrix(parts)
starts_with_parts(subdir_matrix, elements = c("a", "b"))
starts_with_parts(subdir_matrix, elements = c("b", "c"))

KWB-R/kwb.pathdict documentation built on Jan. 13, 2020, 2:24 a.m.