Skip to content

Commit

Permalink
fix alg
Browse files Browse the repository at this point in the history
  • Loading branch information
emitanaka committed Oct 14, 2023
1 parent b1b3fe6 commit 6862b9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/permute.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ permute_parent_more_than_one <- function(xparents, udf, ntrts, nparents = NULL)
alloc_table <- do.call(rbind, results_by_nested)
udf[["...order..."]] <- 1:nrow(udf)
merged_alloc <- tibble::as_tibble(merge(udf, alloc_table))
merged_alloc[merged_alloc[["...order..."]], ]$alloc
merged_alloc[order(merged_alloc[["...order..."]]), ]$alloc
}
} else if(is_null(nparents) | length(nparents) == 0) {
# no nested parents
Expand All @@ -81,7 +81,7 @@ permute_parent_more_than_one <- function(xparents, udf, ntrts, nparents = NULL)
alloc_table <- do.call(rbind, results_by_nested)
udf[["...order..."]] <- 1:nrow(udf)
merged_alloc <- tibble::as_tibble(merge(udf, alloc_table))
merged_alloc[merged_alloc[["...order..."]], ]$alloc
merged_alloc[order(merged_alloc[["...order..."]]), ]$alloc
}
}

Expand Down Expand Up @@ -132,7 +132,7 @@ order_trts.default <- function(x, prov, constrain, ...) {
order_trts.dae <- function(x, prov, constrain, trts, ...) {
# FIXME
dat <- assign_trts(prov$design, order = "systematic", constrain = constrain, .record = FALSE) %>%
serve_table(use_labels = TRUE) %>%
serve_table(label_nested = everything()) %>%
lapply(as.factor) %>%
as.data.frame()
out <- dae::designRandomize(allocated = dat[prov$trt_names],
Expand Down

0 comments on commit 6862b9e

Please sign in to comment.