Running examples in ‘cjbart-Ex.R’ failed
The error most likely occurred in:

> ### Name: IMCE
> ### Title: Heterogeneous Effects Analysis of Conjoint Results
> ### Aliases: IMCE
> 
> ### ** Examples
> 
> subjects <- 5
> rounds <- 2
> profiles <- 2
> obs <- subjects*rounds*profiles
> 
> fake_data <- data.frame(A = sample(c("a1","a2"), obs, replace = TRUE),
+                         B = sample(c("b1","b2"), obs, replace = TRUE),
+                         id1 = rep(1:subjects, each=rounds),
+                         stringsAsFactors = TRUE)
> 
> fake_data$Y <- sample(c(0,1), obs, replace = TRUE)
> 
> cj_model <- cjbart(data = fake_data,
+                    Y = "Y",
+                    id = "id1")
*****Into main of pbart
*****Data:
data:n,p,np: 20, 4, 0
y1,yn: 1, 0
x1,x[n*p]: 1.000000, 1.000000
*****Number of Trees: 50
*****Number of Cut Points: 1 ... 1
*****burn and ndpost: 100, 1000
*****Prior:mybeta,alpha,tau: 2.000000,0.950000,0.212132
*****binaryOffset: 0.385320
*****Dirichlet:sparse,theta,omega,a,b,rho,augment: 0,0,1,0.5,1,4,0
*****nkeeptrain,nkeeptest,nkeeptreedraws: 1000,1000,1000
*****printevery: 100
*****skiptr,skipte,skiptreedraws: 1,1,1

MCMC
done 0 (out of 1100)
done 100 (out of 1100)
done 200 (out of 1100)
done 300 (out of 1100)
done 400 (out of 1100)
done 500 (out of 1100)
done 600 (out of 1100)
done 700 (out of 1100)
done 800 (out of 1100)
done 900 (out of 1100)
done 1000 (out of 1100)
time: 1s
check counts
trcnt,tecnt: 1000,0
> 
> ## Skip if not Unix due to longer CPU time
> if (.Platform$OS.type=='unix') {
+ 
+   het_effects <- IMCE(data = fake_data,
+                       model = cj_model,
+                       attribs = c("A","B"),
+                       ref_levels = c("a1","b1"),
+                       cores = 1)
+ 
+   summary(het_effects)
+ }
Calculating OMCEs for attribute: A [1/2]
Calculating OMCEs for attribute: B [2/2]
Calculating IMCEs
Error in aggregate.formula(formula = agg_formula, data = results, FUN = mean) : 
  argument 'x' is  missing -- it has been renamed from 'formula'
Calls: IMCE -> <Anonymous> -> aggregate.formula
Execution halted