From f9fb29d45b8ff9265dafd49a1fb07addce4b4ce2 Mon Sep 17 00:00:00 2001
From: Julian Sagebiel <julian.sagebiel@idiv.de>
Date: Sun, 15 Dec 2024 22:11:21 +0100
Subject: [PATCH] added transform_util2 but without at and dollar

---
 R/sim_choice.R | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/R/sim_choice.R b/R/sim_choice.R
index d97b9db..7701952 100644
--- a/R/sim_choice.R
+++ b/R/sim_choice.R
@@ -26,6 +26,13 @@ sim_choice <- function(designfile, no_sim=10, respondents=330,ut ,destype=destyp
 
   }
 
+  transform_util2 <- function() {
+
+    mnl_U <-paste(purrr::map_chr(ut[[1]],as.character,keep.source.attr = TRUE),collapse = "",";") %>%
+      stringr::str_replace_all( c( "priors\\[\"" = "" , "\"\\]" = "" ,  "~" = "=", "\\." = "_" ,    "V_"="U_"))
+
+  }
+
 #### Function to simulate and estimate ####
 
   estimate_sim <- function(run=1) {         #start loop
-- 
GitLab