plot.vg {ctpm} | R Documentation |
Produces plots of varigram objects (semi-variance vs. time lag) and model semi-variance functions, with approximate confidence intervals around the semi-variance estimates.
## S3 method for class 'vg'
plot(x, CTPM = NULL, col="black", col.CTPM = "red", fraction = 1, ...)
x |
A |
CTPM |
A |
col |
Color for the empirical variogram. Can be an array. |
col.CTPM |
Color for the model. Can be an array. |
fraction |
The proportion of the variogram object, |
... |
Additional |
For highly irregularly phylogenetic distances with few species, it may be useful to set complete = FALSE
to coarsen the variogram. When this is the cases, species are binned across lags, with the number of lags estimated using either kmeans
or Gaussian Mixture Modelling GMM
clustering with n classes = \sqrt(N)
.
Returns a plot of semi-variance vs. time lag, with the empirical variogram in black and the ctpm
semi-variance function in red if specified.
The errors of the empirical variogram are correlated. Smooth trends are not necessarily significant.
M. J. Noonan, C. H. Fleming.
Noonan, M. J., Fagan, W. F., and Fleming C. H. (2021) “A semi-variance approach to visualising phylogenetic autocorrelation”. Methods in Ecology and Evolution, in press.
vignette("variogram", package = "ctpm")
, variogram
, ctpm.fit
.
#Load package and data
library(ctpm)
data("moid_traits")
data("musteloids")
#Extract the trait of interest from the full dataset
SSD <- moid_traits$SSD
#Calculate variogram
SVF <- variogram(SSD, musteloids)
#Plot the variogram
plot(SVF)