These functions access, subset, replace and evaluate tf objects. For more information on creating tf objects and converting them to/from list, data.frame or matrix, see tfd() and tfb().
Note that these break certain (terrible) R conventions for vector-like objects:

# S3 method for tf
[(x, i, j, interpolate = TRUE, matrix = TRUE)

# S3 method for tf
[(x, i) <- value

Arguments

x

an tf

i

index of the observations (integerish, character or logical, usual R rules apply)

j

The arg used to evaluate the functions. A (list of) numeric vectors.

interpolate

should functions be evaluated (i.e., inter-/extrapolated) for values in arg for which no original data is available? Only relevant for tfd, defaults to TRUE.

matrix

should the result be returned as a matrix or as a list of data.frames? If TRUE, j has to be a (list of a) single vector of arg. See return value.

value

tf object for subassignment. This is (currently) very strictly typed, i.e. only objects that are of the same class and have compatible arg can be subassigned.

Value

If j is missing, a subset of the functions in x as given by i.
If j is given and matrix == TRUE, a numeric matrix of function evaluations in which each row represents one function and each column represents one argval as given in argument j, with an attribute arg=j and row- and column-names derived from x[i] and j.
If j is given and matrix == FALSE, a list of tbl_dfs with columns arg = j and value = evaluations at j for each observation in i.

Details

  • no argument recycling,

  • no indexing with NA,

  • no indexing with names not present in x,

  • no indexing with integers > length(x)

All of these will trigger errors. Subassigning new elements to positions beyond the original length still works and will fill up the missing elements up to that position with NAs, though. This package was developed by fickle, rainbow-colored unicorns.