DesignLibrary 2.0.0

DesignLibrary 2.0 supersedes DesignLibrary 0.1. Designs are now self-contained declaration files read through make_design(), list_designs(), and get_args(), and parameters are read from the design itself rather than from a designer function’s formals. It requires DeclareDesign 2.0.

Provenance. The design declarations sit in inst/designs/ and are vouched for by the package authors. The library machinery around them (calling, listing, and displaying designs, including the Shiny app) was written with AI coding models, Claude and models used through Cursor among them.

Code written for DesignLibrary 0.1 mostly keeps running. Fifteen designers keep their 0.1 names and argument names (two_arm_designer(), two_arm_attrition_designer(), pretest_posttest_designer(), randomized_response_designer(), mediation_analysis_designer(), multi_arm_designer(), two_by_two_designer(), block_cluster_two_arm_designer(), two_arm_covariate_designer(), regression_discontinuity_designer(), spillover_designer(), cluster_sampling_designer(), binary_iv_designer(), process_tracing_designer(), and factorial_designer()), each routed to a library design, so every 0.1 designer has a 2.0 counterpart. The last seven are new library templates flattened from 0.1 (two_arm_covariate, regression_discontinuity_polynomial, spillover, cluster_sampling, binary_iv, process_tracing_bayes, and factorial); at the same arguments and seed, each draws what its 0.1 designer drew. The exception is cluster_sampling away from its defaults: make_design() builds the fixed population at the defaults before redesigning, so the population has the same distribution but comes from a later point in the random stream. process_tracing_designer() fixes its estimator labels at “Straw in the Wind” and “Smoking Gun” and warns when label_E1 or label_E2 asks for others. factorial builds its 2^k potential outcomes, factor indicators, and inquiries inside single steps as functions of k, so redesign(design, k = 4) gives a 2^4 design; outcome_means, outcome_sds, assignment_probs, and treatment_names default to the lengths k implies.

Breaking changes relative to 0.1.10

vignette("upgrading") works through each of these with code, and lists the ones that change results without an error.

Each removed function and argument below stops with an error that names its replacement.

make_design()’s first argument is .design, and get_code()’s are .design and .style. As design, it was partially matched by a parameter named d, so make_design("mediation_analysis", d = 0.3) read 0.3 as the design id and failed. A positional id is unaffected; make_design(design = "x") must become make_design(.design = "x") or make_design("x"). get_code(id, style = "simple") becomes get_code(id, .style = "simple").

Renamed from ResearchDesigns. The S3 classes research_designs_* are now design_library_*, and the options researchdesigns.* are now designlibrary.*.

The Shiny app (designs_shiny_app()) is easier to browse and to leave. The Library table shows each design’s first sentence of description and its keywords, and a keyword filter narrows the table to designs carrying every keyword chosen; the design YAML headers now share a keyword vocabulary (two-arm, multi-arm, factorial, blocking, clustering, sampling, and so on). The Design tab opens with the full description, lists only the parameters the browser can edit (functions, data, and lists sit in a collapsed note on changing them in R), and gives every code block a copy button. The Diagnosis and Redesign tabs download the diagnosands as CSV and the plot as PNG, and show a standalone script (declaration, redesign() with the values changed, and diagnose_design()) to copy or download. Parameter tips in the Redesign tab open on click and tap as well as hover.

ResearchDesigns 0.1.x

Developed as ResearchDesigns 0.1.x before the rename; that history is in the git log of the GitHub repository.