The ultimate cause of your problem is most likely that MRO defaults to a static repository:
By default, Microsoft R Open offers its users predictability using a static CRAN snapshot date. For example, the CRAN repository for Microsoft R Open 3.2.3 is configured to point to a snapshot date of Jan 1, 2016. Consequently, with Microsoft R Open 3.2.3 you'll always get packages as they were at midnight UTC on Jan 1, 2016 by default whenever you use install.packages.
Using a fixed CRAN repository snapshot means that every user of Microsoft R Open has access to the same set of CRAN package versions. This makes sharing R code that relies on R packages easier, and reduces the chance of incompatible R packages being installed on the same system. Learn more about fixed CRAN repository snapshots.
Try
install.packages("nlme",repos="http://cran.r-project.org")
or possibly
install.packages("nlme",repos="http://cran.r-project.org",type="binary")
(if you get a type == "both" cannot be used ...
error).
Another possible source of problems with new versions of recommended packages is that one may have the old version installed in a system-level package directory, while the new version is installed in a user-level directory; check the results of
sapply(.libPaths(),packageVersion,pkg="nlme")
and consider adding something like lib=.libPaths()[2]
to your install.packages()
call.
nlme
is part of r-base and is loaded instead of the new version which would be normally loaded if you just loadnlme
vialibrary()
. One solution could be to loadnlme
before manually when the wrong version is not loaded yet. – Macronucleus