Error in `checkReservedVarNames(code)`

17 views
Skip to first unread message

Nils

unread,
Apr 10, 2026, 11:37:15 PM (12 days ago) Apr 10
to nimble-users
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.

Chris Paciorek

unread,
Apr 12, 2026, 8:07:17 PM (10 days ago) Apr 12
to Nils, nimble-users
Hi Nils,

Yes, that seems odd. I don't think we've seen anything like that before.

1. I assume it passes testing when you run the tests locally on your own machine?
2. Does the GH actions testing fail if run on a Windows and on a MacOS runner in addition to the Ubuntu runner? 
3. Can you share the model code and the code for creating the model that leads to the failure with us?

-Chris

--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/5e41c21a-39c5-48fa-a8ea-f4c4056720aan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages