NIMBLE crashing when running compiled code

38 views
Skip to first unread message

Bernardo S. Scaldaferri

unread,
Jun 30, 2025, 10:55:13 AM6/30/25
to nimble-users
repex.R

Chris Paciorek

unread,
Jul 1, 2025, 2:35:12 PM7/1/25
to Bernardo S. Scaldaferri, nimble-users
Hi Bernardo,

We don't support all of R's operations in the run function of a nimbleFunction because of limitations on what we can compile from R to C++.

In particular you can't use minus in indexing (I'm doing a bit of work right now to make that more clear in our documentation and error-trapping).

Also, you can't use a vector as the second argument to `rep`. 

I haven't fully checked, but I think if you rework your `getClustersN` function to do the equivalent operations in a more 'manual' way, that will hopefully resolve things. Note that since the `run` code will be compiled to C++, you can use loops there without worrying that the loop will be slow.

Feel free to iterate here if that doesn't clear things up or getting things working for you.
-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/63b14068-e3bd-4e7a-b55e-8a3872fe9583n%40googlegroups.com.

Perry de Valpine

unread,
Jul 1, 2025, 2:47:51 PM7/1/25
to paci...@stat.berkeley.edu, Bernardo S. Scaldaferri, nimble-users
A clarification: it should work fine to use a vector as the second argument to `rep`, similarly to how `rep` works in R.


Chris Paciorek

unread,
Jul 1, 2025, 3:07:54 PM7/1/25
to Perry de Valpine, Bernardo S. Scaldaferri, nimble-users
Right, thanks, Perry - I managed to confuse myself when trying something out and botched that part of the response!

Bernardo S. Scaldaferri

unread,
Jul 1, 2025, 9:53:19 PM7/1/25
to nimble-users
Reply all
Reply to author
Forward
0 new messages