plot.vg {ctpm}R Documentation

Plotting methods for variogram objects.

Description

Produces plots of varigram objects (semi-variance vs. time lag) and model semi-variance functions, with approximate confidence intervals around the semi-variance estimates.

Usage

## S3 method for class 'vg'
plot(x, CTPM = NULL, col="black", col.CTPM = "red", fraction = 1, ...)

Arguments

x

A variogram object calculated using variogram.

CTPM

A ctpm evolutionary model object in the same format as the output of ctpm.fit.

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, variogram, that will be plotted.

...

Additional plot.variogram function parameters.

Details

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).

Value

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.

Note

The errors of the empirical variogram are correlated. Smooth trends are not necessarily significant.

Author(s)

M. J. Noonan, C. H. Fleming.

References

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.

See Also

vignette("variogram", package = "ctpm"), variogram, ctpm.fit.

Examples

#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)

[Package ctpm version 1.0.1 Index]