Learn R Programming

DynTxRegime (version 3.2)

TxInfoIntegerWithSubsets-class: Class "TxInfoIntegerWithSubsets"

Description

Stores basic treatment information for a single decision point when treatment is of class "integer" and includes subsets.

Arguments

Objects from the Class

Objects can be created by calls of the form new("TxInfoIntegerWithSubsets", ...). These objects are for convenience in package development and should not be created by users.

Slots

superSet:

An object of class "integer." A vector of all treatment options.

Extends

Classes "TxSubset-class" and "TxInfoWithSubsets-class", directly. Class "TxInfoBasic-class" by class "TxInfoWithSubsets-class", distance 2. Class "SingleDecisionPoint-class" by class "TxInfoBasic-class", distance 3.

Methods

.compare

signature(object = "TxInfoIntegerWithSubsets", vec1 = "integer", vec2 = "integer"): Integer vectors of treatment options to compare element-by_element for equality. Method is not exporeted.

.convertTx

signature(object = "TxInfoIntegerWithSubsets", txVec = "numeric"): Convert additional input txVec to an integer vector. Method is not exported.

.getLevels

signature(object = "TxInfoIntegerWithSubsets", txVec = "integer"): Determine levels of integer vector input txVec. Method is not exported

Examples

Run this code
# NOT RUN {
showClass("TxInfoIntegerWithSubsets")

fSet <- function(x1){
          subsets <- list("subset1" = c(0L,1L),
                          "subset2" = c(0L))

          ptsSubset <- character(length(x1))
          ptsSubset[x1 > 0] <- "subset1"
          ptsSubset[x1 <= 0] <- "subset2"
}

obj <- new("TxInfoIntegerWithSubsets",
           superSet = c(0L,1L),
           txName = "A1",
           ptsSubset = c("subset1", "subset2", "subset1", "subset2"),
           subsetRule = fSet,
           subsets = list("subset1" = c(0L,1L),
                          "subset2" = c(0L)),
           singleton = c(FALSE,TRUE,FALSE,TRUE))

txVec1 <- c(0L,1L,0L,1L)
txVec2 <- c(0L,0L,0L,1L)

DynTxRegime:::.compare(object = obj, vec1 = txVec1, vec2 = txVec2)

DynTxRegime:::.convertTx(object = obj, txVec = c(0L,1L,0L))

DynTxRegime:::.getLevels(object = obj, txVec = txVec1)

DynTxRegime:::.getSuperSet(object = obj)

DynTxRegime:::.getTxName(object = obj)

DynTxRegime:::.getPtsSubset(object = obj)

DynTxRegime:::.getSingleton(obj)

DynTxRegime:::.getSubsetRule(obj)

DynTxRegime:::.getSubsets(obj)

DynTxRegime:::.validTx(obj, c(1L,0L,0L,0L))

try(DynTxRegime:::.validTx(obj, c(0L,0L,2L,1L)))

# }

Run the code above in your browser using DataLab