Description Usage Arguments Value Examples
Does post-processing of canonical analysis object from vegan to extract spline gradients
1 | splineGradient(object, Bdf, Gnames = NULL, predB = NULL, plot = T, ...)
|
object |
The fitted rda/cca or capscale object |
Bdf |
Integer vector giving the degrees of freedom (number of columns) of the bases used. |
Gnames |
Gradient names corresponding to the bases. |
predB |
List containing the new set of bases for prediction. |
plot |
Draw plot of the gradient. predB must be supplied. |
... |
Arguments to be passed on to the plot command. |
Gradt Fitted gradient values
Env.scores Correlation scores for spline and linear covariates, for adding to a biplot
pred.Gradt List containing the fitted gradient values for predB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(PitTraps)
Locn=PitTraps$Locn
distance=PitTraps$distance
Counts=PitTraps[,-c(1,2)]
B=bSpline(distance,degree=2,df=5) #Spline basis for distance
Bpred=predict(B,newx=min(distance):max(distance)) #For prediction
CAP.fit=capscale((Counts>0)~B+Locn,dist="bray") #Fit RDA on PCOs
Gradients=splineGradient(CAP.fit,Bdf=5,predB=list(Bpred),type="l")
#Draw triplot
env=Gradients$Env.scores
ordiplot(CAP.fit,display = c("sp", "wa", "cn")[1:2],scaling=3,
cex=0.6,xlim=c(-1.5,1.5),ylim=c(-1.5,1.5))
arrows(0,0,env[1,],env[2,],length=0.05,col="blue",lwd=1.5)
text(env[1,],env[2,],colnames(env),cex=0.8,adj=c(0,0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.