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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: AddExample
> ### Title: Add an example to an existing PowerPlot or GridPlot
> ### Aliases: AddExample
> 
> ### ** Examples
> 
> 
> ## For more examples, see ?PowerPlot
> 
> ## Set up a grid of n, delta and sd:
> sse_pars = list(
+   n = seq(from = 10, to = 60, by = 4),
+   delta = seq(from = 0.5, to = 1.5, by = 0.1), # effect size
+   sd = seq(.1, 1.1, .2)) # Standard deviation
> ## Define a power function using these parameters:
> PowFun <- function(n, delta, sd){ # power for a t-test at alpha = .05
+   ptt = power.t.test(n = n/2, delta = delta, sd = sd,
+                      sig.level = 0.05)
+   return(ptt$power)
+ }
> ## Evaluate PowFun across the grid defined by sse_pars:
> power_array = PowerGrid(pars = sse_pars, fun = PowFun, n_iter = NA)
> 
> ## ======================
> ## PowerPlot
> ## ======================
> PowerPlot(power_array,
+           slicer = list(sd = .7),
+           )
> AddExample(power_array,
+            slicer = list(sd = .7), # be sure to cut out the same plain as above
+            example = list(delta = .9),
+            target_value = .9,
+            col = 'blue')
> AddExample(power_array,
+            slicer = list(sd = .7),
+            example = list(delta = c(.7, 1)), # multiple examples
+            target_value = .9,
+            col = 'yellow')
> ## Careful, you can move the slicer argument to example:
> AddExample(power_array,
+            example = list(delta = 1.2, sd = .7), # delta (x-axis) first
+            target_value = .9,
+            col = 'green')
> ## Careful, because you can put the wrong value on x-axis!
> AddExample(power_array,
+            example = list(sd = .7, delta = 1.2), # sd first?!
+            target_value = .9,
+            col = 'red')
> 
> ## ======================
> ## GridPlot
> ## ======================
> GridPlot(power_array, target_value = .9)
Warning: The target value wasn't achieved at any of the parameter combinations in x. Therefore, no lines can be drawn.
Error in 1:ncol(y_rec) : argument of length 0
Calls: GridPlot
Execution halted