Package: cbcTools Check: examples New result: ERROR Running examples in ‘cbcTools-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cbc_design > ### Title: Make a choice-based conjoint survey design > ### Aliases: cbc_design > ### Keywords: DoE.base design experiment idefix logit logitr mixed mnl mxl > > ### ** Examples > > library(cbcTools) > > # A simple conjoint experiment about apples > > # Generate all possible profiles > profiles <- cbc_profiles( + price = c(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5), + type = c("Fuji", "Gala", "Honeycrisp"), + freshness = c('Poor', 'Average', 'Excellent') + ) > > # Make a survey by randomly sampling from all possible profiles > # (This is the default setting where method = 'random') > design_random <- cbc_design( + profiles = profiles, + n_resp = 100, # Number of respondents + n_alts = 3, # Number of alternatives per question + n_q = 6 # Number of questions per respondent + ) > > # Make a survey using a full factorial design and include a "no choice" option > design_full <- cbc_design( + profiles = profiles, + n_resp = 100, # Number of respondents + n_alts = 3, # Number of alternatives per question + n_q = 6, # Number of questions per respondent + method = 'full', # Change this to use a different method, e.g. 'orthogonal', or 'dopt' + no_choice = TRUE + ) > > # Make a survey by randomly sampling from all possible profiles > # with each level of the "type" attribute appearing as an alternative > design_random_labeled <- cbc_design( + profiles = profiles, + n_resp = 100, # Number of respondents + n_alts = 3, # Number of alternatives per question + n_q = 6, # Number of questions per respondent + label = "type" + ) > > # Make a Bayesian D-efficient design with a prior model specified > # Note that by speed can be improved by setting parallel = TRUE > design_bayesian <- cbc_design( + profiles = profiles, + n_resp = 100, # Number of respondents + n_alts = 3, # Number of alternatives per question + n_q = 6, # Number of questions per respondent + n_start = 1, # Defaults to 5, set to 1 here for a quick example + priors = list( + price = -0.1, + type = c(0.1, 0.2), + freshness = c(0.1, 0.2) + ), + method = "CEA", + parallel = FALSE + ) Error in idefix::Decode(des = D$design, n.alts = n_alts, alt.cte = alt_cte, : 'n.alts' does not seem correct based on nrow(des) Calls: cbc_design -> make_design_bayesian -> Execution halted