plot.decay | R Documentation |
Takes the output of decay.model() and plots a distance-decay curve, either a negative exponential or power law function as estimated with decay.model().
## S3 method for class 'decay'
plot(x, xlim=c(0,max(x$data.x)), ylim=c(0,1),
add=FALSE, remove.dots=FALSE, col="black", pch=1, lty=1, lwd=5, cex=1, ...)
x |
the output of decay.model(). |
xlim |
the range of spatial distances to be plotted, default is from 0 to the maximum distance in the data. |
ylim |
the range of assemblage similarities or dissimilarities to be plotted, default is from 0 to 1. |
add |
add to the previous plot. |
remove.dots |
remove the dots from the plot, thus retaining just the decay curve. |
col |
colour used. |
pch |
symbol used for points. |
lty |
line type. |
lwd |
line width. |
cex |
scale of text and symbols. |
... |
other parameters for plotting functions. |
Andrés Baselga
Gómez-Rodríguez, C. & Baselga, A. 2018. Variation among European beetle taxa in patterns of distance decay of similarity suggests a major role of dispersal processes. Ecography 41: 1825-1834
decay.model
# presence/absence tables for longhorn beetles of South and North Europe
data(ceram.s)
data(ceram.n)
# spatial coordinates of territories in South and North Europe
data(coords.s)
data(coords.n)
# dissimilarity matrices
ceram.s.sim<-beta.pair(ceram.s)$beta.sim
ceram.n.sim<-beta.pair(ceram.n)$beta.sim
# spatial distances in km
distgeo.s<-dist(coords.s[,1:2])
distgeo.n<-dist(coords.n[,1:2])
# Negative exponential models for the decay of similarity with spatial distance
decay.south<-decay.model(y=1-ceram.s.sim, x=distgeo.s, y.type="sim", model.type="exp")
decay.north<-decay.model(y=1-ceram.n.sim, x=distgeo.n, y.type="sim", model.type="exp")
# Plot the decay models
plot.decay(decay.south, col="red")
plot.decay(decay.north, col="blue", add=TRUE)
# Equivalent models for the increase of dissimilarity with spatial distance
increase.south<-decay.model(y=ceram.s.sim, x=distgeo.s, y.type="dissim", model.type="exp")
increase.north<-decay.model(y=ceram.n.sim, x=distgeo.n, y.type="dissim", model.type="exp")
# Plot the decay models
plot.decay(increase.south, col="red")
plot.decay(increase.north, col="blue", add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.