Learn R Programming

rpact (version 5.0.0)

obtain: Extract a single parameter

Description

Fetch a parameter from a parameter set.

Usage

obtain(x, ..., output)

# S3 method for ParameterSet obtain(x, ..., output = c("named", "labeled", "value", "list"))

fetch(x, ..., output)

# S3 method for ParameterSet fetch(x, ..., output = c("named", "labeled", "value", "list"))

Arguments

x

The ParameterSet object to fetch from.

...

One or more variables specified as:

  • a literal variable name

  • a positive integer, giving the position counting from the left

  • a negative integer, giving the position counting from the right. The default returns the last parameter. This argument is taken by expression and supports quasi-quotation (you can unquote column names and column locations).

output

A character defining the output type as follows:

  • "named" (default) returns the named value if the value is a single value, the value inside a named list otherwise

  • "value" returns only the value itself

  • "list" returns the value inside a named list

See Also

fetch.TrialComparison() for selecting contained objects from a comparison.

Examples

Run this code
if (FALSE) {
getDesignInverseNormal() |> fetch(kMax)
getDesignInverseNormal() |> fetch(kMax, output = "list")
}

Run the code above in your browser using DataLab