# NOT RUN {
data(plethodon)
Y.gpa<-gpagen(plethodon$land, print.progress = FALSE) #GPA-alignment
gdf <- geomorph.data.frame(Y.gpa, species = plethodon$species,
site = plethodon$site)
# Morphological disparity for entire data set
morphol.disparity(coords ~ 1, groups = NULL, data = gdf,
iter = 999, print.progress = FALSE)
# Morphological disparity for entire data set, accounting for allometry
morphol.disparity(coords ~ Csize, groups= NULL, data = gdf,
iter = 999, print.progress = FALSE)
# Morphological disparity without covariates, using overall mean
morphol.disparity(coords ~ 1, groups= ~ species*site, data = gdf,
iter = 999, print.progress = FALSE)
# Morphological partial disparities for overal mean
morphol.disparity(coords ~ 1, groups= ~ species*site, partial = TRUE,
data = gdf, iter = 999, print.progress = FALSE)
# Morphological disparity without covariates, using group means
morphol.disparity(coords ~ species*site, groups= ~species*site,
data = gdf, iter = 999, print.progress = FALSE)
# Morphological disparity of different groups than those
# described by the linear model
morphol.disparity(coords ~ Csize + species*site, groups= ~ species,
data = gdf, iter = 999, print.progress = FALSE)
# Extracting components
MD <- morphol.disparity(coords ~ Csize + species*site, groups= ~ species,
data = gdf, iter = 999, print.progress = FALSE)
MD$Procrustes.var # just the Procrustes variances
### Morphol.disparity can be used with previously-defined
### procD.lm or lm.rrpp class objects
data(plethspecies)
Y.gpa<-gpagen(plethspecies$land) #GPA-alignment
gp.end<-factor(c(0,0,1,0,0,1,1,0,0)) #endangered species vs. rest
names(gp.end)<-plethspecies$phy$tip
gdf <- geomorph.data.frame(Y.gpa, phy = plethspecies$phy, gp.end = gp.end)
pleth.ols <- procD.lm(coords ~ Csize + gp.end,
data = gdf, iter = 999) # ordinary least squares
pleth.pgls <- procD.pgls(coords ~ Csize + gp.end, phy = phy,
data = gdf, iter = 999) # phylogenetic generalized least squares
summary(pleth.ols)
summary(pleth.pgls)
morphol.disparity(f1 = pleth.ols, groups = ~ gp.end, data = gdf,
iter = 999, print.progress = FALSE)
morphol.disparity(f1 = pleth.pgls, groups = ~ gp.end, data = gdf,
iter = 999, print.progress = FALSE)
### Morphol.disparity using RRPP
PW <- pairwise(pleth.ols, groups = gp.end)
summary(PW, test.type = 'var')
# }
Run the code above in your browser using DataLab