tf_gather | R Documentation |
tfd
-objectSimilar in spirit to tidyr::gather()
, but does NOT put the values in the
gathered columns into one very long "value"-column while labeling the different
original columns in a very long "key"-column – instead it creates a tfd
-column
containing the functional measurements of the columns given in ...
.
tf_gather(
data,
...,
key = ".tfd",
arg = NULL,
domain = NULL,
evaluator = tf_approx_linear
)
data |
a data frame – note that |
... |
A selection of columns to collect as a |
key |
the name of the created |
arg |
optional. Argument values for the functions. If not provided, will be guessed from the column names as well.
See also |
domain |
optional. Range of possible |
evaluator |
optional. A function accepting arguments x, arg, evaluations. See |
a modified data.frame
with a tfd
column replacing the ...
.
dplyr::select()
Other tidyfun data wrangling functions:
tf_evaluate.data.frame()
,
tf_nest()
,
tf_spread()
,
tf_unnest()
(d <- dplyr::as.tbl(data.frame(refund::DTI[1:5, ]$cca[, 1:10])))
tf_gather(d)
tf_gather(d, key = "cca_tf")
tf_gather(d, arg = seq(0, 1, length.out = 10))$cca
(d2 <- dplyr::bind_cols(id = rownames(d), d))
tf_gather(d2, -id) # tf_gather(d2, matches("cca")); tf_gather(d2, -1); etc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.