Error using the function lme() in R

I am trying to use the formula lme() in R to analyse the response of some factors in my variable "Peso_seco", but I keep getting an error that is making my life very difficult. What I am trying is:

model <- lme(Tritordeum$Peso seco ~ Tratamiento + Hongo + Tratamiento*Hongo,
random=~1|Tritordeum$Línea,
na.action = na.omit)

And R gives me the next error:

Error in parse(text = paste("~", paste(names, collapse = "+"))) :
:1:19: unexpected symbol
1: ~ Tritordeum+Peso seco
^

Any idea of why is this happening? Thanks in advance for your time,
Maria.

Hello @mariasanber94 and welcome. From your code it looks like you have a space rather than _ in the Peso seco variable. If that is not the problem, could you do a reproducible example? That way, it is much easier to help.

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