Missing data with nlme

Good, having the NA present and the lme() error message means the first step is done!

Unlike other objects (like lm objects), lme objects are set to "fail" if NA values are present by default. This forces the user to decide what we want to do with them.

You can see in the documentation for lme():

na.action
a function that indicates what should happen when the data contain NAs. The default action (na.fail) causes lme to print an error message and terminate if there are any incomplete observations.

Other commonly used options (see ?na.action) are na.omit, which is what you could be used to lm models using and na.exclude. These two options do slightly different things, so which is most useful will depend on your goals but both will stop the current error message.

RCI0WAT <- lme(X0WAT ~ Treat*DateTreatment,
        random = ~1|Year/Rep,
        na.action = na.omit,
        data = dat )

Another option we always have is to manually remove the NA. For example, if we want to remove all rows that have an NA anywhere (which is not always desired), you could do something like

RCI0WAT <- lme(X0WAT ~ Treat*DateTreatment,
        random = ~1|Year/Rep,
        data = na.omit(dat) )