* using log directory 'd:/Rcompile/CRANpkg/local/4.7/powergrid.Rcheck'
* using R Under development (unstable) (2026-05-09 r90031 ucrt)
* using platform: x86_64-w64-mingw32
* R was compiled by
    gcc.exe (GCC) 14.3.0
    GNU Fortran (GCC) 14.3.0
* running under: Windows Server 2022 x64 (build 20348)
* using session charset: UTF-8
* current time: 2026-05-10 16:59:38 UTC
* checking for file 'powergrid/DESCRIPTION' ... OK
* this is package 'powergrid' version '0.5.0'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'powergrid' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... [0s] OK
* checking whether the package can be loaded with stated dependencies ... [0s] OK
* checking whether the package can be unloaded cleanly ... [0s] OK
* checking whether the namespace can be loaded with stated dependencies ... [0s] OK
* checking whether the namespace can be unloaded cleanly ... [0s] OK
* checking loading without being on the library search path ... [0s] OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [4s] OK
* checking Rd files ... [1s] OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... [1s] ERROR
Running examples in 'powergrid-Ex.R' failed
The error most likely occurred in:

> ### 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
* checking for unstated dependencies in 'tests' ... OK
* checking tests ... [24s] OK
  Running 'testthat.R' [24s]
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... [2s] ERROR
Error(s) in re-building vignettes:
--- re-building 'powergrid.Rmd' using rmarkdown

Quitting from powergrid.Rmd:212-216 [GridPlot]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `1:ncol(y_rec)`:
! argument of length 0
---
Backtrace:
    ▆
 1. └─powergrid::GridPlot(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'powergrid.Rmd' failed with diagnostics:
argument of length 0
--- failed re-building 'powergrid.Rmd'

SUMMARY: processing the following file failed:
  'powergrid.Rmd'

Error: Vignette re-building failed.
Execution halted

* checking PDF version of manual ... [20s] OK
* checking HTML version of manual ... [5s] OK
* DONE
Status: 2 ERRORs
