library(lavaan)
borModel <- '
NDVI ~ nTot + T61 + Wet
nTot ~ T61
'
#note meanstructure = TRUE to obtain intercepts
borFit <- sem(borModel, data = boreal, meanstructure = TRUE)
spatialCorrect(borFit, boreal$x, boreal$y)
Run the code above in your browser using DataLab