Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid conflict when diagnosing expand_design() object #238

Merged
merged 3 commits into from Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions R/multi_arm_designer.R
Expand Up @@ -131,6 +131,7 @@ multi_arm_designer <- function(N = 30,
estimator_expr <- expr(declare_estimator(
handler = function(data){
estimates <- rbind.data.frame(!!!estimators)
names(estimates)[names(estimates) == "N"] <- "N_DIM"
estimates$estimator_label <- !!estimator_labels
estimates$estimand_label <- rownames(estimates)
estimates$estimate <- estimates$coefficients
Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/test_designers.R
Expand Up @@ -109,6 +109,18 @@ for(designer in designers){
"max", "inspector_min", "inspector_step")), 0)
}
)

test_that(
# Testing that `diagnose_design(expand_design())` works when calling every
# possible design parameter by checking if estimator column names overlap with
# designer terms
desc = paste0("No column names in estimator data.frame conflict with parameters in ", designer),
code = {
params <- designer_attr$definitions$names
estimator <- draw_estimates(the_designer())
expect_length(intersect(params, names(estimator)), 0)
}
)
}
}

Expand Down