add: Add Objects to a Collection

View source: R/class_trial_comparison.R

addR Documentation

Add Objects to a Collection

Description

S3 generic for adding objects. The TrialComparison method delegates to ⁠$add()⁠ and modifies the existing comparison by reference.

The TrialComparison method appends objects to the comparison.

Usage

add(x, ...)

## S3 method for class 'TrialComparison'
add(x, ...)

Arguments

x

An object supporting an add() method, such as a TrialComparison.

...

For TrialComparison, designs, plans, simulations, lists or comparisons to append. The optional named argument objects is appended after the other arguments, with the same rules as getComparison().

Value

The modified comparison for TrialComparison.

See Also

getComparison(), delete()

Examples

comparison <- getComparison(fixed = getDesignFixed())
comparison |> add(sequential = getDesignGroupSequential(kMax = 2))
comparison |> add(objects = list(other = getDesignFixed(alpha = 0.05)))


rpact documentation built on Nov. 17, 2026, 1:07 a.m.