@@ -49,13 +49,13 @@ simulate_choices <- function(data, utility, setspp, bcoeff, decisiongroups = c(0
4949
5050 tictoc :: tic(" whole simulate choices" )
5151
52- tictoc :: tic(" assign keys for bcoeff) " )
52+ tictoc :: tic(" assign keys for bcoeff" )
5353 # ## unpack the bcoeff list so variables are accessible
5454 for (key in names(bcoeff )) {
5555 assign(key , bcoeff [[key ]])
5656 }
5757
58- tictoc :: toc()
58+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
5959
6060
6161 by_formula <- function (equation ) { # used to take formulas as inputs in simulation utility function
@@ -98,7 +98,7 @@ simulate_choices <- function(data, utility, setspp, bcoeff, decisiongroups = c(0
9898 data <- data %> %
9999 dplyr :: group_by(ID ) %> %
100100 dplyr :: mutate(!!! manipulations )
101- tictoc :: toc()
101+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
102102
103103 # browser()
104104 #
@@ -112,7 +112,7 @@ simulate_choices <- function(data, utility, setspp, bcoeff, decisiongroups = c(0
112112 # # split dataframe into groups
113113 subsets <- split(data , data $ group )
114114
115- tictoc :: toc()
115+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
116116
117117 tictoc :: tic(" for each group calculate utility" )
118118 # # for each group calculate utility
@@ -123,7 +123,7 @@ simulate_choices <- function(data, utility, setspp, bcoeff, decisiongroups = c(0
123123
124124 # # put data from eachgroup together again
125125 data <- dplyr :: bind_rows(subsets )
126- tictoc :: toc()
126+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
127127
128128 tictoc :: tic(" add random component" )
129129 # # add random component and calculate total utility
@@ -139,9 +139,9 @@ simulate_choices <- function(data, utility, setspp, bcoeff, decisiongroups = c(0
139139 as.data.frame()
140140
141141
142- tictoc :: toc()
142+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
143143
144- tictoc :: toc()
144+ message( capture.output( tictoc :: toc(log = FALSE , quiet = TRUE )) )
145145
146146 message(" \n data has been created \n " )
147147
0 commit comments