DeclareDesign Community

Replace a step in many designs easily?

I have used expand_design() to create an object with many designs. Is there an easy way to replace a single step in all those designs (a new outcome formula, for example)?

With my already-created object designs, I try

designs_new <- designs %>% 
  replace_step(model, 
               declare_model(N = pop_size, 
                             U = rnorm(N), 
                             potential_outcomes(Y ~ Z + U)))

and get back

Error: Please send a single design object to the design argument, 
  typically created using the + operator.

If I recall correctly, you have to use replace_step on a single desing, it is not a generic function like some of the other utilities. eg

designs_new <- designs # make a copy of list
for (i in seq(length(designs_new))
    designs_new[[i]] <- replace_step(designs_new[[i]], "model_step_label", new_model_step)