tree: Turn the output of str() into a tree diagram
Description
The super useful function str() uses .. to indicate the level
of sub-elements of an object, which may be difficult to read. This function
uses vertical pipes to connect all sub-elements on the same level, so it is
clearer which elements belong to the same parent element in an object with a
nested structure (such as a nested list).
Usage
tree(...)
Value
A character string as a raw_string().
Arguments
...
Arguments to be passed to str() (note that the
comp.str is hardcoded inside this function, and it is the only
argument that you cannot customize).