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()
.
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 – uses slightly different defaults for names of unnested columns
than tidyr::unnest()
.
For data.frames
, make sure to have an ID column in your data before unnesting!
If it does not include an ID column with a unique identifier for each row, you will not
be able to match arg-value pairs to the different 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.