TxpSliceList-class {toxpiR} | R Documentation |
List of TxpSlice objects
Description
Extension of S4Vectors::SimpleList that requires uniquely-named elements and holds only TxpSlice objects.
Usage
TxpSliceList(...)
## S4 method for signature 'TxpSliceList'
txpValueNames(x, simplify = FALSE)
## S4 method for signature 'TxpSliceList'
txpTransFuncs(x, simplify = FALSE)
## S4 method for signature 'TxpSliceList'
duplicated(x)
as.TxpSliceList(x)
Arguments
... |
TxpSlice object to create |
x |
|
simplify |
Scalar logical, when |
Details
Note, there is no coercion for TxpSlice to TxpSliceList
because unique
names are required.
Functions
-
txpValueNames,TxpSliceList-method
: Returnlist
oftxpValueNames
slots for the contained TxpSlice objects, orvector
whensimplify = TRUE
-
txpTransFuncs,TxpSliceList-method
: Returnlist
oftxpTransFuncs
slots for the contained TxpSlice objects, or TxpTransFuncList whensimplify = TRUE
-
duplicated,TxpSliceList-method
: Returns logical vector oflength(x)
, whereTRUE
indicates a duplicate slice in the list; see base::duplicated
Examples
## Create TxpSlice objects
s1 <- TxpSlice("input1", list(linear = function(x) x))
s2 <- TxpSlice(c("input2", "input3"),
list(log = function(x) log(x), sqrt = function(x) sqrt(x)))
## Create TxpSliceList
sl <- TxpSliceList(s1 = s1, s2 = s2)
## Accessors
txpValueNames(sl)
txpValueNames(sl, simplify = TRUE)
txpTransFuncs(sl)
txpTransFuncs(sl, simplify = TRUE)
## Coercion
as(list(s1 = TxpSlice("hello"), s2 = TxpSlice("user")), "TxpSliceList")
as.TxpSliceList(c(s1 = TxpSlice("hello"), s2 = TxpSlice("user")))
## Concatenation
c(sl, TxpSliceList(s3 = TxpSlice("input4")))
## Reduce TxpSliceList to single slice
Reduce(merge, sl)