'lme can't find functions to set correlation / covariance structure and weights

I'm currently trying to fit a multivariate mixed model.

I'm trying to include weights and a covariance structure like so:

model <- nlme::lme(fixed = ..., data = ...., 
   random = ..., weights = varIdent(form = ~ 1 | Gender))

or

model <- nlme::lme(fixed = ..., data = ...., random = ..., corr = corAR1())

I also tried using correlation instead of corr.

However, I get error messages:

Error in corAR1() : could not find function "corAR1"

Error in varIdent(form = ~1 | Gender) : could not find function "varIdent"

I have tried deleting the global environment and loading everything fresh. I also reinstalled nlme and typed getAnywhere(corAR1) and getAnywhere(varIdent) as suggested in this post.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source