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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: eval_design
> ### Title: Calculate Power of an Experimental Design
> ### Aliases: eval_design
> 
> ### ** Examples
> 
> #Generating a simple 2x3 factorial to feed into our optimal design generation
> #of an 11-run design.
> factorial = expand.grid(A = c(1, -1), B = c(1, -1), C = c(1, -1))
> 
> optdesign = gen_design(candidateset = factorial,
+                       model= ~A + B + C, trials = 11, optimality = "D", repeats = 100)
> 
> #Now evaluating that design (with default anticipated coefficients and a effectsize of 2):
> eval_design(design = optdesign, model= ~A + B + C, alpha = 0.2)
    parameter            type     power
1 (Intercept)    effect.power 0.9622638
2           A    effect.power 0.9622638
3           B    effect.power 0.9622638
4           C    effect.power 0.9622638
5 (Intercept) parameter.power 0.9622638
6           A parameter.power 0.9622638
7           B parameter.power 0.9622638
8           C parameter.power 0.9622638
============Evaluation Info============
[1m• Alpha = [0m0.2 [1m• Trials = [0m11 [1m• Blocked = [0mFALSE
[1m• Evaluating Model = [0m~A + B + C
[1m• Anticipated Coefficients = [0mc(1, 1, 1, 1)
> 
> #Evaluating a subset of the design (which changes the power due to a different number of
> #degrees of freedom)
> eval_design(design = optdesign, model= ~A + C, alpha = 0.2)
    parameter            type     power
1 (Intercept)    effect.power 0.9659328
2           A    effect.power 0.9659328
3           C    effect.power 0.9659328
4 (Intercept) parameter.power 0.9659328
5           A parameter.power 0.9659328
6           C parameter.power 0.9659328
============Evaluation Info============
[1m• Alpha = [0m0.2 [1m• Trials = [0m11 [1m• Blocked = [0mFALSE
[1m• Evaluating Model = [0m~A + C
[1m• Anticipated Coefficients = [0mc(1, 1, 1)
> 
> #We do not have to input the model if it's the same as the model used
> #During design generation. Here, we also use the default value for alpha (`0.05`)
> eval_design(optdesign)
    parameter            type     power
1 (Intercept)    effect.power 0.7991116
2           A    effect.power 0.7991116
3           B    effect.power 0.7991116
4           C    effect.power 0.7991116
5 (Intercept) parameter.power 0.7991116
6           A parameter.power 0.7991116
7           B parameter.power 0.7991116
8           C parameter.power 0.7991116
============Evaluation Info============
[1m• Alpha = [0m0.05 [1m• Trials = [0m11 [1m• Blocked = [0mFALSE
[1m• Evaluating Model = [0m~A + B + C
[1m• Anticipated Coefficients = [0mc(1, 1, 1, 1)
> 
> #Halving the signal-to-noise ratio by setting a different effectsize (default is 2):
> eval_design(design = optdesign, model= ~A + B + C, alpha = 0.2, effectsize = 1)
    parameter            type     power
1 (Intercept)    effect.power 0.6021367
2           A    effect.power 0.6021367
3           B    effect.power 0.6021367
4           C    effect.power 0.6021367
5 (Intercept) parameter.power 0.6021367
6           A parameter.power 0.6021367
7           B parameter.power 0.6021367
8           C parameter.power 0.6021367
============Evaluation Info============
[1m• Alpha = [0m0.2 [1m• Trials = [0m11 [1m• Blocked = [0mFALSE
[1m• Evaluating Model = [0m~A + B + C
[1m• Anticipated Coefficients = [0mc(0.500, 0.500, 0.500, 0.500)
> 
> #With 3+ level categorical factors, the choice of anticipated coefficients directly changes the
> #final power calculation. For the most conservative power calculation, that involves
> #setting all anticipated coefficients in a factor to zero except for one. We can specify this
> #option with the "conservative" argument.
> 
> factorialcoffee = expand.grid(cost = c(1, 2),
+                               type = as.factor(c("Kona", "Colombian", "Ethiopian", "Sumatra")),
+                               size = as.factor(c("Short", "Grande", "Venti")))
> 
> designcoffee = gen_design(factorialcoffee,
+                          ~cost + size + type, trials = 29, optimality = "D", repeats = 100)
Error in n - 1 : non-numeric argument to binary operator
Calls: gen_design
Execution halted