Skip to contents

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.

Examples

comparison <- getComparison(
    fixed = getDesignFixed(),
    sequential = getDesignGroupSequential(kMax = 2)
)
comparison |> delete("fixed")
#> Design comparison
#> 
#> 1 objects; 2 comparison rows; 19 columns.
#> 
#> Object types:
#>     Group sequential design : 1
#> 
#> Observed metrics (across objects, stages and situations):
#>     Maximum number of stages : 2
#>     Significance level       : 0.025
#>     Type II error rate       : 0.2
#> 
#> Available operations:
#>     summary(x)                        : Compare differences
#>     as.data.frame(x)                  : Access all data
#>     plot(x, xAxis = ..., yAxis = ...) : Plot selected parameters
#>     getObjects(x)                     : Access contained objects
comparison |> delete(index = 1)
#> Trial comparison
#> 
#> 0 objects; 0 comparison rows; 0 columns.
#> 
#> Available operations:
#>     summary(x)                        : Compare differences
#>     as.data.frame(x)                  : Access all data
#>     plot(x, xAxis = ..., yAxis = ...) : Plot selected parameters
#>     getObjects(x)                     : Access contained objects
comparison |>
    add(getDesignFixed()) |>
    delete(1)
#> Trial comparison
#> 
#> 0 objects; 0 comparison rows; 0 columns.
#> 
#> Available operations:
#>     summary(x)                        : Compare differences
#>     as.data.frame(x)                  : Access all data
#>     plot(x, xAxis = ..., yAxis = ...) : Plot selected parameters
#>     getObjects(x)                     : Access contained objects