Problem wth "check"

Hi,
So I’ve been trying to check my stan code to verify everything is ok, but I keep getting that error:
Error in system(command, as.integer(flag), f, stdout, stderr, timeout) :
character string expected as first argument
In addition: Warning message:
In system2(file.path(R.home(component = “bin”), “R”), args = “CMD config CC”, :
running command ‘“C:/PROGRA~1/R/R-40~1.4/bin/x64/R” CMD config CC’ had status 1
I’m not sure how to fix it!

I can only gather that you are using rstan, but would need more information to try to find out what’s not working (also not being an rstan user I may not be able to help at all)? As it is it looks pretty cryptic to me.

Was there any resolution to this? I’m running into the same issue

I think I found the issue. In my code, I had a line commented out that I had accidentally used the # sign to make a comment for within the comment (as I sometimes forget I’m not writing an R script). Thus the following was creating the error:

model {
  // A normal comment in stan #A bad comment using R notation
  y ~ normal(mu, sigma);
}

I feel I should add that this seems like an undesirable feature that comments can throw errors, but I’m not a computer scientist.

1 Like

Comments using # are deprecated in Stan but should not throw a nasty error. There is a known bug in RStan which does cause problems with #, though.