#(set working directory)

#read data
grid2 <- read.csv("grid2.csv", header= TRUE, sep = ",", na.strings="-1")

library(nlme)

#attempt to fit model after setting control options
lmeCtlList <- lmeControl(maxIter=50, msMaxIter=50, tolerance=1e-4, msTol=1e-5, nlmStepMax=5, returnObject=TRUE ) #msVerbose=TRUE
global_model3 <-  lme(logarea ~ year+summ_d, data= grid2, random= ~ year + summ_d | subject, control=lmeCtlList)
