Skip to contents

Deprecated in 2.0. Call the designer once and redesign() the result: redesign(designer(), N = c(100, 200)) does what expand_design(designer, N = c(100, 200)) did, and reaches the same names, since a designer's argument is a name the design reads. expand_design() still works and warns once per session.

Usage

expand_design(.designer, ..., .expand = TRUE)

Arguments

.designer

(required) A function returning a design.

...

(optional) Named parameter values to vary, passed to .designer as its arguments.

.expand

(optional) If TRUE (the default), expand the grid; if FALSE, zip parallel vectors.

Value

A design or a named list of designs, as redesign() returns.

Details

The one thing it did that redesign() cannot is rebuild a design whose shape depends on an argument, such as a designer that adds a step when blocked = TRUE. For that, call the designer with each value.

Examples

designer <- function(N = 50) {
  declare_model(N = N, Y = rnorm(N)) + declare_inquiry(mu = mean(Y))
}
# deprecated
designs <- suppressWarnings(expand_design(designer, N = c(10, 20)))
# instead
designs <- redesign(designer(), N = c(10, 20))
length(designs)
#> [1] 2