delete: Delete an Object from a Collection

View source: R/class_trial_comparison.R

deleteR Documentation

Delete an Object from a Collection

Description

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

The TrialComparison method deletes one contained object by position or name.

Usage

delete(x, ...)

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

Arguments

x

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

...

For TrialComparison, exactly one index, supplied by position or name: a positive integer position or an exact object name. Invalid selections leave the comparison unchanged. Removing the last object leaves an empty comparison.

Value

The modified comparison for TrialComparison.

See Also

getComparison(), add()

Examples

comparison <- getComparison(
    fixed = getDesignFixed(),
    sequential = getDesignGroupSequential(kMax = 2)
)
comparison |> delete("fixed")
comparison |> delete(index = 1)
comparison |>
    add(getDesignFixed()) |>
    delete(1)


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