0
I’m trying to run the function ...
m.ex=nls(dados$var1~y0*exp(r*dados$dias), data=dados, start = list(y0=10,r=0.005));m.ex
** ... in the data set:**
str(data)
'data.frame': 24 obs. of 2 variables:
$ dias: int 1 1 1 10 10 10 20 20 20 30 ...
$ var1: chr "2.1" "4.8" "3.7" "6" ...
when executing the function, the error appears:
Error in lhs - rhs : argumento não-numérico para operador binário
What could be wrong in function?
Thank you to those who can answer and give a solution!!
var1
It is like Character, being that it should be with some numerical format. Try to put adados$var1 <- as.numeric(dados$var1)
before nls– Jorge Mendes
If not, I recommend editing the question with the result of
dput(head(dados))
. That way other people can reproduce and help in the solution.– Jorge Mendes
Very obg!! It worked!
– Thaissa Soares