spec {unnest} | R Documentation |
Unnest spec
Description
Unnest spec is a nested list with the same structure as the
nested json. It specifies how the deeply nested lists ought to be
unnested. spec()
is a handy constructor for spec lists. s()
is a
shorthand alias for spec()
.
Usage
spec(
selector = NULL,
...,
as = NULL,
children = NULL,
groups = NULL,
include = NULL,
exclude = NULL,
stack = NULL,
process = NULL,
default = NULL
)
s(
selector = NULL,
...,
as = NULL,
children = NULL,
groups = NULL,
include = NULL,
exclude = NULL,
stack = NULL,
process = NULL,
default = NULL
)
Arguments
selector |
A shorthand syntax for an
|
as |
name for this field in the extracted data.frame |
children , ... |
Unnamed list of children spec. |
groups |
Named list of specs to be processed in parallel. The return
value is a named list of unnested data.frames. The results is the same as
when each spec is |
include , exclude |
A list, a numeric vector or a character vector specifying components to include or exclude. A list can combine numeric indexes and character elements to extract. |
stack |
Whether to stack this node (TRUE) or to spread it (FALSE). When
|
process |
Extra processing step for this element. Either NULL for no processing (the default), "as_is" to return the entire element in a list column, "paste" to paste elements together into a character column. |
default |
Default value to insert if the |
Value
s()
: a canonical spec - a list consumed by C++ unnesting routines.
Examples
s("a")
s("a//c2")
s("a/2/c2,cid")