recurse {jqr} | R Documentation |
Search through a recursive structure - extract data from all levels
recurse(.data, ...) recurse_(.data, ..., .dots)
.data |
input. This can be JSON input, or an object of class
|
... |
Comma separated list of unquoted variable names |
.dots |
Used to work around non-standard evaluation |
dots |
dots |
x <- '{"name": "/", "children": [ {"name": "/bin", "children": [ {"name": "/bin/ls", "children": []}, {"name": "/bin/sh", "children": []}]}, {"name": "/home", "children": [ {"name": "/home/stephen", "children": [ {"name": "/home/stephen/jq", "children": []}]}]}]}' x %>% recurse(.children[]) %>% build_object(name) x %>% recurse(.children[]) %>% build_object(name) %>% string