| getPathsAndValuesFromRecursiveList | R Documentation |
Get Paths and String Values from Recursive List
getPathsAndValuesFromRecursiveList(x, path = "")
x |
a list |
path |
start path |
data frame with columns path and value. The
data frame contains all non-list elements that are contained in x,
coerced to character, in column value, together with the sequence of
element names "leading" to the value when starting at x. For example,
the path to element x$a$a1 is /a/a1 (see example).
# Define a recursive list
x <- list(
a = list(a1 = "A1", a2 = "A2"),
b = list(b1 = "B1", b2 = "B2", b3 = "B3"),
c = list(c1 = list(c11 = "C11"), c2 = list(c21 = "C21", c22 = "C22"))
)
# Get all non-list-elements and their "path" as a data frame
getPathsAndValuesFromRecursiveList(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.