Error: unexpected ' } ' in " } "

Hi, I am trying to do this in RStudio but it keeps telling me that there is an error: unexpected ' } ' in " } ". I checked all the parenthesis for any mistake but I believe they are well used. I am new to R so any help is welcome.

min.err1=function(data,par){
with(data,sum((y-par[1]-par[2](par[4]/x)(1-exp(-x/par[4]))
-par[3]((par[4]/x)(1-exp(-x/par[4]))-exp(-x/par[4])))^2)
}

Hi Trini :slight_smile:
The problem isn't with the curly bracket itself, it's the other brackets. You have 11 open brackets "(" and only 10 close brackets ")" so R gets confused when it encounters the curly bracket!
Hope that helps!
Clare

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.