## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
if (dir.exists("../inst/designs")) {
  options(DesignLibrary.root = normalizePath("..", winslash = "/"))
}

## ----message = FALSE----------------------------------------------------------
library(DesignLibrary)

design <- two_arm_designer(N = 100, ate = 0.25)
set.seed(343)
draw_estimates(design)

## ----error = TRUE-------------------------------------------------------------
try({
simple_two_arm_designer(N = 50)
})

## ----error = TRUE-------------------------------------------------------------
try({
get_design_code(two_arm_designer())
})

## -----------------------------------------------------------------------------
get_code("two_arm_flexible")

## ----error = TRUE-------------------------------------------------------------
try({
block_cluster_two_arm_designer(N = 200, rho = 0.5)
})

## -----------------------------------------------------------------------------
design <- block_cluster_two_arm_designer(
  N_blocks = 5, N_clusters_in_block = 4, N_i_in_cluster = 10, ate = 0.1
)

## -----------------------------------------------------------------------------
design <- multi_arm_designer(m_arms = 3)
set.seed(343)
draw_estimates(design)[, c("estimator", "term", "estimate", "inquiry")]

## -----------------------------------------------------------------------------
draw_estimands(mediation_analysis_designer())

## -----------------------------------------------------------------------------
design <- process_tracing_designer(label_E1 = "Hoop")

## -----------------------------------------------------------------------------
design <- two_arm_designer(args_to_fix = "N")

## -----------------------------------------------------------------------------
names(factorial_designer())

## -----------------------------------------------------------------------------
designs <- redesign(two_arm_designer(), N = c(50, 100))
length(designs)

