##set up site-pair table using the southwest data set
sppData <- southwest[, c(1,2,14,13)]
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)
##extracts splines
exSplines <- isplineExtract(gdmMod)
##plot spline(s)
#spline for winter precip (bio19)
plot(exSplines[[1]][,"bio19"], exSplines[[2]][,"bio19"], type="l",
lwd=3, xlab="Winter precipitation (mm)", ylab="Partial Ecological Distance")
Run the code above in your browser using DataLab