I am trying to run a nonlinear least squares regression in R and keep coming across the same error message which I can't seem to fix.
My function so far:
nls(y ~ 1033.89+(2461*cos*(2*3.14*(t-18)/24)),
data=data.frame, start=list(x=1, y=1))
where t=c(1:24) and data.frame contains x and y variables of equal length.
This error message continues to pop up:
Error in parse(text = x, keep.source = FALSE) :
:2:0: unexpected end of input
1: ~
^
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
Any suggestions?