Skip to contents

Prints the structure of a directory tree up to a specified maximum level of depth. It lists all files and directories under the specified path, displaying them in a tree-like structure.

Usage

tree(path, max.level = 2, level = 0, prefix = "")

Arguments

path

The root path from which to start listing the directory structure.

max.level

The maximum depth of directories to list.

level

Internal parameter used for recursion, indicating the current level of depth.

prefix

Internal parameter used for formatting the printed tree structure.

Value

NULL, called for its side effect of printing the directory structure.

Examples

metabodecon_dir <- system.file(package = "metabodecon")
tree(metabodecon_dir, max.level = 1)
#> /home/runner/work/_temp/Library/metabodecon
#> ├── DESCRIPTION
#> ├── INDEX
#> ├── Meta/
#> ├── NAMESPACE
#> ├── NEWS.md
#> ├── R/
#> ├── WORDLIST
#> ├── data/
#> ├── example_datasets/
#> ├── help/
#> └── html/