TxpTransFuncList-class | R Documentation |
Extension of S4Vectors::SimpleList that holds only NULL
or
TxpTransFunc objects.
TxpTransFuncList(...)
as.TxpTransFuncList(x)
... |
TxpTransFunc object or function to create |
x |
|
When ...
includes function objects, TxpTransFuncList
will attempt to
coerce them to TxpTransFunc and return an error if any of the elements
cannot be coerced to TxpTransFunc.
## Create TxpTransFunc objects
tf1 <- TxpTransFunc(function(x) x)
tf2 <- TxpTransFunc(function(x) sqrt(x))
## Create TxpTransFuncList
tfl <- TxpTransFuncList(linear = tf1, sqrt = tf2, cube = function(x) x^3)
tfl[[3]](3) == 27
tfl[["sqrt"]](4) == 2
## Concatenate
c(tfl, tfl)
## names
names(c(tfl, tfl))
# note: names are printed as '' when missing; NULL is printed when list item
# is NULL
names(TxpTransFuncList(function(x) x, NULL))
TxpTransFuncList(function(x) x, NULL)
## coercion
as(function(x) x, "TxpTransFuncList")
as.TxpTransFuncList(function(x) x)
as(TxpTransFunc(function(x) x), "TxpTransFuncList")
as.TxpTransFuncList(TxpTransFunc(function(x) x))
as(list(function(x) x, sqrt = function(x) sqrt(x)), "TxpTransFuncList")
as.TxpTransFuncList(list(function(x) x, sqrt = function(x) sqrt(x)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.