0

I just started learning R a few hours ago and I'm trying to do a nonlinear regression to find values for the B coefficients of the formula I created. I want to use position and varResis values to find estimatedOi values, as close as possible of measuredOi values (pretty straight forward).

values = read.table("values.txt")
position<-c(values[,1])
varResis<-c(values[,2])
measuredOi<-c(values[,3] )    

estimatedOi<-nls(measuredOi ~ B0+B1 * (position*varResis)^B2+B3*sin(B4*position^B5),data=values,start=start)

My issue: I get this error code:

Error in start[[i]] : object of type 'closure' is not subsettable

Although I can find a lot of answers about this error, most of them is because certain variables are named after pre-existing in-built functions names. I changed the name of every variable and that didn't fix my error, so I guess the problem is in the nls function I wrote.

I haven't coded for many years and I know this is probably just a dumb problem, but I'm feeling lost over here...

Thank you so much, Regards.

DGKarlsson
  • 1,091
  • 12
  • 18

0 Answers0