pcnm(dis, threshold, w, dist.ret = FALSE)
dis
. The PCNM functions are used to express distances in rectangular form
that is similar to normal explanatory variables used in, e.g.,
constrained ordination (rda
, cca
and
capscale
) or univariate regression (lm
)
together with environmental variables (row weights should be supplied
with cca
; see Examples). This is regarded as a more
powerful method than forcing rectangular environmental data into
distances and using them in partial mantel analysis
(mantel.partial
) together with geographic distances
(Legendre et al. 2008, but see Tuomisto & Ruokolainen 2008).
The function is based on pcnm
function in Dray's unreleased
spacemakeR package. The differences are that the current
function uses spantree
as an internal support
function. The current function also can use prior weights for rows by
using weighted metric scaling of wcmdscale
. The use of
row weights allows finding orthonormal PCNMs also for correspondence
analysis (e.g., cca
).
Tuomisto, H. & Ruokolainen, K. (2008) Analyzing or explaining beta diversity? A reply. Ecology 89, 3244--3256.
spantree
. ## Example from Borcard & Legendre (2002) data(mite.xy) pcnm1 <- pcnm(dist(mite.xy)) op <- par(mfrow=c(1,3)) ## Map of PCNMs in the sample plot ordisurf(mite.xy, scores(pcnm1, choi=1), bubble = 4, main = "PCNM 1") ordisurf(mite.xy, scores(pcnm1, choi=2), bubble = 4, main = "PCNM 2") ordisurf(mite.xy, scores(pcnm1, choi=3), bubble = 4, main = "PCNM 3") par(op) ## Plot first PCNMs against each other ordisplom(pcnm1, choices=1:4) ## Weighted PCNM for CCA data(mite) rs <- rowSums(mite)/sum(mite) pcnmw <- pcnm(dist(mite.xy), w = rs) ord <- cca(mite ~ scores(pcnmw)) ## Multiscale ordination: residual variance should have no distance ## trend msoplot(mso(ord, mite.xy))
Run the code above in your browser using DataCamp Workspace