ctpm.fit {ctpm} | R Documentation |
Fit models to phylogenetic data.
Description
This function is currently a wrapper for methods implemented in the package slouch
.
Usage
ctpm.fit(data, phylo, model = NULL, time.units = "Ma")
Arguments
data |
A vector of continuous species trait data. This vector needs to be of the same length and same order as phylo$tip.label. |
phylo |
An object of class 'phylo'. |
model |
The model to fit. Can be one of |
time.units |
A character defining the units of the edge lengths of the phylogentic tree. Defaults to "Ma" |
Details
Fits evolutionary models to species trait data using the methods implemented in the package slouch
and returns a model fit object (class ctmm) that is used for plotting a fitted model against an emprical variogram.
Value
Returns a model fit object (class ctmm) that is used for plotting a fitted model against an emprical variogram.
Note
Running summary
on the fitted model is not currently meaningful.
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")
, plot.variogram
, %#%
.
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)
#Fit the model
FIT <- ctpm.fit(SSD, musteloids, model = "BM")
#Plot the variogram and fitted model
plot(SVF, FIT)