| as.data.frame.tf | R Documentation |
Various converters to turn tfb- or tfd-vectors into data.frames or
matrices, or even an actual R function.
## S3 method for class 'tf'
as.data.frame(x, row.names = NULL, optional = FALSE, unnest = FALSE, ...)
## S3 method for class 'tf'
as.matrix(x, arg, interpolate = FALSE, ...)
## S3 method for class 'tf'
as.function(x, ...)
x |
a |
row.names |
|
optional |
not used. |
unnest |
if |
... |
additional arguments to be passed to or from methods. |
arg |
a vector of argument values / evaluation points for |
interpolate |
should functions be evaluated (i.e., inter-/extrapolated)
for values in |
for as.data.frame.tf: if unnest is FALSE (default), a
one-column data.frame with a tf-column containing x. if unnest is
TRUE, a 3-column data frame with columns id (containing (unique) names of
x or a numeric identifier if x is unnamed), arg, and value, with each row containing
one function evaluation at the original arg-values.
for as.matrix.tf: a matrix with one row per function and one
column per arg.
for as.function.tf: an R function with argument arg that
evaluates x on arg and returns the list of function values
f <- tfd(sin(seq(0, 2 * pi, length.out = 11)), arg = seq(0, 1, length.out = 11))
as.data.frame(f)
as.data.frame(f, unnest = TRUE)
as.matrix(f)
fun <- as.function(f)
fun(c(0, 0.5, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.