I am in the process of developing an R-package with a multinormal ordinal probit regression model, based on NIMBLE (vers. 1.4.2), with tests, examples and vignettes. Everything works as expected and the package passes all R-CMD-checks both locally and via Github-actions on Mac, Windows and Linux. However, on the Github-action test-coverage (Ubuntu 24.04.4 LTS, R version 4.5.3, nimble 1.4.2), I receive the fatal error
Error: Error: running the tests in ‘testthat.R’ failed
Error: Error: Failure in `/home/runner/work/_temp/package/baytaAAR/baytaAAR-tests/testthat.Rout.fail`
[...]
Error in `checkReservedVarNames(code)`: Found variable name that conflicts with C++ keywords: if, if, if, if, if, if, if, if. Please use a different name."
Of course, the model code does not use "if" as an keyword. The only cause for this error I can imagine is the fact that I use several if-constructions to stitch together the model code. This is allowed according to the manual and, as stated above, generally the model runs fine this way. Also when I run the model manually and check the variable names with '
getVarNames()', no "if"s (or other seemingly problematic variable names) turn up.Every hint what is going wrong here is appreciated and particularly how to solve this issue.