Learn R Programming

DynTxRegime (version 3.2)

TxInfoFactorWithSubsets-class: Class "TxInfoFactorWithSubsets"

Description

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

Arguments

Objects from the Class

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

Slots

superSet:

An object of class "character." 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 = "TxInfoFactorWithSubsets", vec1 = "factor", vec2 = "factor"): Factor vectors of treatment options to compare element-by_element for equality. Method is not exporeted.

.convertTx

signature(object = "TxInfoFactorWithSubsets", txVec = "ANY"): Convert additional input txVec to a factor vector. Method is not exported.

.getLevels

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

Examples

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

fSet <- function(x1){
          subsets <- list("subset1" = c("A","B"),
                          "subset2" = c("A"))

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

obj <- new("TxInfoFactorWithSubsets",
           superSet = c("A","B"),
           txName = "A1",
           ptsSubset = c("subset1", "subset2", "subset1", "subset2"),
           subsetRule = fSet,
           subsets = list("subset1" = c("A","B"),
                          "subset2" = c("A")),
           singleton = c(FALSE,TRUE,FALSE,TRUE))

txVec1 <- as.factor(c("A","B","A","B"))
txVec2 <- as.factor(c("A","A","A","B"))

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

DynTxRegime:::.convertTx(object = obj, txVec = c("A","B","A"))

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

DynTxRegime:::.getSuperSet(object = obj)

DynTxRegime:::.getTxName(object = obj)

DynTxRegime:::.getPtsSubset(object = obj)

DynTxRegime:::.getSingleton(object = obj)

DynTxRegime:::.getSubsetRule(object = obj)

DynTxRegime:::.getSubsets(object = obj)

DynTxRegime:::.validTx(object = obj, c("B","A","A","A"))

try(DynTxRegime:::.validTx(object = obj, c("B","B","A","A")))

# }

Run the code above in your browser using DataLab