From ce44d04c5b689673eb1ced86588801a1120a34bf Mon Sep 17 00:00:00 2001 From: Julian Sagebiel <julian.sagebiel@idiv.de> Date: Sun, 29 Dec 2024 15:17:25 +0100 Subject: [PATCH] modified bcoeff but not working --- R/sim_choice.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/R/sim_choice.R b/R/sim_choice.R index 877b4b2..4dcc0df 100644 --- a/R/sim_choice.R +++ b/R/sim_choice.R @@ -21,7 +21,14 @@ sim_choice <- function(designfile, no_sim = 10, respondents = 330, u ,designtype message("'simple' is deprecated and will be removed in the future. Use 'exact' instead.") } + # Create a lookup table for bcoeff names + bcoeff_lookup <- tibble::tibble( + original = names(bcoeff), + modified = stringr::str_replace_all(names(bcoeff), "_", "") + ) + # Replace all underscores in bcoeff names with an empty string + names(bcoeff) <- bcoeff_lookup$modified @@ -130,8 +137,8 @@ transform_util2 <- function() { `priors\\["` = "", `"\\]` = "", `~` = "=", - `\\.` = "_", - `V_` = "U_" + # `\\.` = "_", ## can be deleted when everything works + `V.` = "U_" ## was originally V_ )) %>% # Replace only relevant database variables stringr::str_replace_all(stats::setNames( -- GitLab