| tf_unnest | R Documentation |
tf-objects / list columns into "long" tables.Similar in spirit to tidyr::unnest(), the reverse of tf_nest().
The tf-method simply turns a single tfd or tfb vector into a "long" tibble::tibble().
tf_unnest(data, cols, arg, interpolate = TRUE, ...)
## S3 method for class 'tf'
tf_unnest(data, cols, arg, interpolate = TRUE, ...)
## S3 method for class 'data.frame'
tf_unnest(
data,
cols,
arg,
interpolate = TRUE,
keep_empty = FALSE,
ptype = NULL,
names_sep = "_",
names_repair = "check_unique",
...
)
data |
a data.frame or a |
cols |
< When selecting multiple columns, values from the same row will be recycled to their common size. |
arg |
optional values for the |
interpolate |
return function values for |
... |
not used currently |
keep_empty |
By default, you get one row of output for each element
of the list that you are unchopping/unnesting. This means that if there's a
size-0 element (like |
ptype |
Optionally, a named list of column name-prototype pairs to
coerce |
names_sep |
If |
names_repair |
Used to check that output data frame has valid names. Must be one of the following options:
See |
Caution: this uses slightly different defaults for names of unnested columns
than tidyr::unnest().
For data.frames, include an ID column with a unique row identifier before
unnesting. Without it, arg-value pairs cannot be matched back to their
original functions after unnesting.
a "long" data frame with tf-columns expanded into arg, value-
columns.
tf_evaluate.data.frame()
Other tidyfun data wrangling functions:
tf_evaluate.data.frame(),
tf_gather(),
tf_nest(),
tf_spread()
d <- dplyr::tibble(id = 1:3)
d$f <- tf_rgp(3, 11L)
tf_unnest(d, f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.