Learn R Programming

tidypmc (version 2.0)

path_string: Print a hierarchical path string

Description

Print a hierarchical path string from a vector of names and levels

Usage

path_string(x, n)

Value

a character vector

Arguments

x

a vector of names

n

a vector of numbers with indentation level

Author

Chris Stubben

Examples

Run this code
x <- c("carnivores", "bears", "polar", "grizzly", "cats", "tiger", "rodents")
n <- c(1, 2, 3, 3, 2, 3, 1)
path_string(x, n)

Run the code above in your browser using DataLab