tidy: Tidying 'CrmPackClass' objects

tidyR Documentation

Tidying CrmPackClass objects

Description

[Experimental]

In the spirit of the broom package, provide a method to convert a CrmPackClass object to a (list of) tibbles.

Following the principles of the broom package, convert a CrmPackClass object to a (list of) tibbles. This is a basic, default representation.

[Experimental]

A method that tidies a GeneralData object.

[Experimental]

A method that tidies a Data object.

[Experimental]

A method that tidies a DataGrouped object.

[Experimental]

A method that tidies a DataDA object.

[Experimental]

A method that tidies a DataDual object.

[Experimental]

A method that tidies a DataParts object.

[Experimental]

A method that tidies a DataMixture object.

[Experimental]

A method that tidies a DataOrdinal object.

[Experimental]

A method that tidies a DataCombo object.

[Experimental]

A method that tidies a HierarchicalData object.

[Experimental]

A method that tidies a HierarchicalModel object.

[Experimental]

A method that tidies a LogisticIndepBeta object.

[Experimental]

A method that tidies a Effloglog object.

Usage

tidy(x, ...)

## S4 method for signature 'CrmPackClass'
tidy(x, ...)

## S4 method for signature 'GeneralData'
tidy(x, ...)

## S4 method for signature 'Data'
tidy(x, ...)

## S4 method for signature 'DataGrouped'
tidy(x, ...)

## S4 method for signature 'DataDA'
tidy(x, ...)

## S4 method for signature 'DataDual'
tidy(x, ...)

## S4 method for signature 'DataParts'
tidy(x, ...)

## S4 method for signature 'DataMixture'
tidy(x, ...)

## S4 method for signature 'DataOrdinal'
tidy(x, ...)

## S4 method for signature 'DataCombo'
tidy(x, ...)

## S4 method for signature 'HierarchicalData'
tidy(x, ...)

## S4 method for signature 'Simulations'
tidy(x, ...)

## S4 method for signature 'ComboSimulations'
tidy(x, ...)

## S4 method for signature 'HierarchicalSimulations'
tidy(x, ...)

## S4 method for signature 'HierarchicalModel'
tidy(x, ...)

## S4 method for signature 'LogisticIndepBeta'
tidy(x, ...)

## S4 method for signature 'Effloglog'
tidy(x, ...)

## S4 method for signature 'IncrementsMaxToxProb'
tidy(x, ...)

## S4 method for signature 'IncrementsRelative'
tidy(x, ...)

## S4 method for signature 'CohortSizeDLT'
tidy(x, ...)

## S4 method for signature 'CohortSizeMin'
tidy(x, ...)

## S4 method for signature 'CohortSizeMax'
tidy(x, ...)

## S4 method for signature 'CohortSizeRange'
tidy(x, ...)

## S4 method for signature 'CohortSizeParts'
tidy(x, ...)

## S4 method for signature 'IncrementsMin'
tidy(x, ...)

## S4 method for signature 'IncrementsRelative'
tidy(x, ...)

## S4 method for signature 'IncrementsRelativeDLT'
tidy(x, ...)

## S4 method for signature 'IncrementsRelativeParts'
tidy(x, ...)

## S4 method for signature 'NextBestNCRM'
tidy(x, ...)

## S4 method for signature 'NextBestNCRMLoss'
tidy(x, ...)

## S4 method for signature 'DualDesign'
tidy(x, ...)

## S4 method for signature 'DesignCombo'
tidy(x, ...)

## S4 method for signature 'HierarchicalDesign'
tidy(x, ...)

## S4 method for signature 'ArmConditionList'
tidy(x, ...)

## S4 method for signature 'DesignArm'
tidy(x, ...)

## S4 method for signature 'Samples'
tidy(x, ...)

## S4 method for signature 'HierarchicalSamples'
tidy(x, ...)

Arguments

x

(CrmPackClass)
the object to be tidied.

...

potentially used by class-specific methods.

Value

A (list of) tibble(s) representing the object in tidy form.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The tibble object.

The list of tibble objects.

The list of tibble objects.

The list of tibble objects.

Usage Notes

The prior observations are indicated by a Cohort value of 0 in the returned tibble.

Examples

CohortSizeConst(3) %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
# Create a sample Data object
sample_data <- Data(
  x = c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
  y = c(0, 0, 0, 0, 0, 0, 1, 0),
  cohort = c(1, 2, 3, 4, 5, 6, 6, 6),
  doseGrid = c(0.1, 0.5, 1.5, 3, 6, seq(from = 10, to = 80, by = 2)),
  response = c(0, 0, 0, 0, 0, 1, NA, NA),
  backfilled = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE)
)

# Tidy the Data object
tidied_data <- tidy(sample_data)

# Print the tidied data
print(tidied_data)
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultData() %>% tidy()
.DefaultDataOrdinal() %>% tidy()
.DefaultDataGrouped() %>% tidy()
.DefaultDataDA() %>% tidy()
.DefaultSimulations() %>% tidy()
.DefaultLogisticIndepBeta() %>% tidy()
.DefaultEffloglog() %>% tidy()
IncrementsMaxToxProb(prob = c("DLAE" = 0.2, "CRS" = 0.05)) %>% tidy()
CohortSizeRange(intervals = c(0, 20), cohort_size = c(1, 3)) %>% tidy()
.DefaultCohortSizeDLT() %>% tidy()
.DefaultCohortSizeMin() %>% tidy()
.DefaultCohortSizeMax() %>% tidy()
.DefaultCohortSizeRange() %>% tidy()
CohortSizeParts(cohort_sizes = c(1, 3)) %>% tidy()
.DefaultIncrementsMin() %>% tidy()
CohortSizeRange(intervals = c(0, 20), cohort_size = c(1, 3)) %>% tidy()
x <- .DefaultIncrementsRelativeDLT()
x %>% tidy()
.DefaultIncrementsRelativeParts() %>% tidy()
NextBestNCRM(
  target = c(0.2, 0.35),
  overdose = c(0.35, 1),
  max_overdose_prob = 0.25
) %>%
  tidy()
.DefaultNextBestNCRMLoss() %>% tidy()
.DefaultDualDesign() %>% tidy()
options <- McmcOptions(
  burnin = 100,
  step = 1,
  samples = 2000
)

emptydata <- Data(doseGrid = c(1, 3, 5, 10, 15, 20, 25, 40, 50, 80, 100))

model <- LogisticLogNormal(
  mean = c(-0.85, 1),
  cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
  ref_dose = 56
)

samples <- mcmc(emptydata, model, options)
samples %>% tidy()

crmPack documentation built on July 5, 2026, 9:06 a.m.