powered by
Print a hierarchical path string from a vector of names and levels
path_string(x, n)
a character vector
a vector of names
a vector of numbers with indentation level
Chris Stubben
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