Found an incomplete binary expression - are you missing the right hand side?

Hi all, I’m running into an error I haven’t seen before - I’m sure there is a simple fix but I haven’t found any solutions and there are next to no mentions online. The error is: “Found an incomplete binary expression - are you missing the right hand side?”

The code generating the error is:

transformed parameters{
  vector[N] res;
  res[1] = 0;
  for(n in 2:N){
    res[n] = f_pass[n-1] - (beta[1] * s_elev[n-1] + beta[2] * dop[n-1] + beta[3] * dop[n-1]^2 + beta[4] * s_mt[n-1] + beta[5] * s_cumics[n-1] + int + u[year[n-1]] + res[n-1] + f_rem[n-1]);
  }
}

Specifically, the line of code generating the error is the single line held within the for loop.

Thanks for the help!

Hi, as a general note, posting incomplete code like this is typically not useful in identifying problems in your code. The error might make reference to this line, but could be due to some other section in the code.

From what you do give however, I would assume this issue arises due to the usage of int in the summation.