Learn R Programming

path.chain (version 1.0.0)

path_chain: Get directory structure and create path_chain object

Description

Returns `path_chain` object, which reflects structure of the folder passed with `path` param

Usage

path_chain(path, naming = basename, levels = +Inf, only.directories = FALSE)

Value

path_chain object

Arguments

path

root of the directory structure

naming

function which defines naming convention

levels

number of hierarchy levels that recursion should go deep; defaults to +Inf

only.directories

boolean to ignore files and only considers directories.

Examples

Run this code
tmp <- create_temp_dir("files")
create_sample_dir(tmp, override = TRUE)
fs::dir_tree(tmp)
chainable.path <- path_chain(tmp)
chainable.path$data$persons.csv
# With customized naming convention
chainable.path <- path_chain(tmp, naming = naming_k)
chainable.path$kData$kPersons

Run the code above in your browser using DataLab