##set up site-pair table using the southwest data set
sppData <- southwest[c(1,2,13,14)]
envTab <- southwest[c(2:ncol(southwest))]
sitePairTab <- formatsitepair(sppData, 2, XColumn="Long", YColumn="Lat",
sppColumn="species", siteColumn="site",
predData=envTab)
##create GDM
gdmMod <- gdm(sitePairTab, geo=TRUE)
##plot GDM
plot(gdmMod, plot.layout=c(3,3))
Run the code above in your browser using DataLab