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 TxpSliceList object; MUST give unique names to each slice

x

TxpSliceList object

simplify

Scalar logical, when TRUE the returned list is simplified to a vector/TxpTransFuncList object

Details

Note, there is no coercion for TxpSlice to TxpSliceList because unique names are required.

Functions

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)

[Package toxpiR version 1.2.1 Index]