The evolution of an R package includes both additions and deletions. Some functions remain necessary, some are replaced by better functions, and others prove either problematic or redundant if there are better alternatives. Over the last few years, geomorph has mostly evolved by additions. The repertoire of functions is now rather impressive. However, recently, some of the functions have become redundant, especially as functions in the package, *RRPP*, have offered better alternatives for the analytical functions in geomorph (specifically, those that use randomization of residuals in permutation procedures, RRPP). Therefore, with version 3.1.0, we decided to deprecate some functions in lieu of better options available in *RRPP*. This vignette illustrates how to use alternative functions and update scripts for veterans, but should also be a good introduction for new users.

The following is a summary of major changes in version 3.1.0, showing old functions and new alternatives:

geomorph 3.0.7 function | status | geomorph 3.1.0 / RRPP alternative |
---|---|---|

advanced.procD.lm | deprecated | procD.lm + pairwise (RRPP) |

procD.allometry | deprecated | procD.lm + anova (RRPP) + plotAllometry (new geomorph function) |

nested.update | deprectaed | anova (RRPP) (Can do much more than nested.update could) |

trajectory.analysis | moved | Now in RRPP with improved functionality |

By eliminating or updating some of the older functions, the overall functionality of geomorph has increased (addition by subtraction). To illustrate the improvements in detail, we focus on one data example below.

These data consist of head landmarks, tail landmarks, and indicators for their semilandmarks (sliders) for larval salamanders, from an experimental study (Levis et al. 2016). Salamanders from different families (egg clutches) were exposed to different herbicide treatments. For our examples, we will focus on tail shape. First, let’s perform GPA.

`## Loading required package: RRPP`

`## Loading required package: rgl`

```
data("larvalMorph")
Y.gpa <- gpagen(larvalMorph$tailcoords, curves = larvalMorph$tail.sliders,
ProcD = FALSE, print.progress = FALSE)
plot(Y.gpa)
```

Next, let’s define some putative models of shape variation that would be biologically relevant.

```
gdf <- geomorph.data.frame(Y.gpa, treatment = larvalMorph$treatment,
family = larvalMorph$family)
fit.size <- procD.lm(coords ~ log(Csize),
data = gdf, print.progress = FALSE) # simple allometry model
fit.family<- procD.lm(coords ~ log(Csize) * family,
data = gdf, print.progress = FALSE) # unique family allometries
fit.treatment<- procD.lm(coords ~ log(Csize) * treatment/family,
data = gdf, print.progress = FALSE) # unique treatment: family allometries
fit.size
```

```
##
## Linear Model fit with lm.rrpp
##
## Number of observations: 114
## Number of dependent variables: 128
## Data space dimensions: 113
## Sums of Squares and Cross-products: Type I
## Number of permutations: 1000
## Call: procD.lm(f1 = coords ~ log(Csize), data = gdf, print.progress = FALSE)
```

```
##
## Linear Model fit with lm.rrpp
##
## Number of observations: 114
## Number of dependent variables: 128
## Data space dimensions: 113
## Sums of Squares and Cross-products: Type I
## Number of permutations: 1000
## Call: procD.lm(f1 = coords ~ log(Csize) * family, data = gdf, print.progress = FALSE)
```

```
##
## Linear Model fit with lm.rrpp
##
## Number of observations: 114
## Number of dependent variables: 128
## Data space dimensions: 113
## Sums of Squares and Cross-products: Type I
## Number of permutations: 1000
## Call: procD.lm(f1 = coords ~ log(Csize) * treatment/family, data = gdf,
## print.progress = FALSE)
```

In geomorph 3.0.7, one could use **summary** to produce an ANOVA table. That still works in geomorph 3.1.0, but the **anova** function (in *RRPP*) is much more flexible!

The following are the typical ANOVA tables for each model:

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on F distributions
##
## Df SS MS Rsq F Z Pr(>F)
## log(Csize) 1 0.43661 0.43661 0.16289 21.794 3.6061 0.001 **
## Residuals 112 2.24377 0.02003 0.83711
## Total 113 2.68038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize), data = gdf, print.progress = FALSE)
```

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on F distributions
##
## Df SS MS Rsq F Z Pr(>F)
## log(Csize) 1 0.43661 0.43661 0.16289 22.6513 3.6388 0.001 **
## family 3 0.18040 0.06013 0.06730 3.1197 2.1814 0.011 *
## log(Csize):family 3 0.02021 0.00674 0.00754 0.3495 -1.5587 0.943
## Residuals 106 2.04316 0.01928 0.76227
## Total 113 2.68038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize) * family, data = gdf, print.progress = FALSE)
```

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on F distributions
##
## Df SS MS Rsq F Z Pr(>F)
## log(Csize) 1 0.43661 0.43661 0.16289 27.0380 3.8048 0.001
## treatment 5 0.41129 0.08226 0.15344 5.0940 3.5567 0.001
## log(Csize):treatment 5 0.07090 0.01418 0.02645 0.8782 -0.0573 0.552
## log(Csize):treatment:family 18 0.40515 0.02251 0.15116 1.3939 1.3211 0.100
## Residuals 84 1.35642 0.01615 0.50606
## Total 113 2.68038
##
## log(Csize) **
## treatment **
## log(Csize):treatment
## log(Csize):treatment:family .
## Residuals
## Total
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize) * treatment/family, data = gdf,
## print.progress = FALSE)
```

In geomorph 3.0.7, one could use advanced.procD.lm to perform ANOVA on one reduced and one full model. With **anova** in *RRPP*, one can directly compare any number of models. For example

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Effect sizes (Z) based on F distributions
##
## ResDf Df RSS SS MS Rsq
## coords ~ log(Csize) (Null) 112 1 2.2438 0.00000
## coords ~ log(Csize) * family 106 6 2.0432 0.20061 0.033434 0.07484
## coords ~ log(Csize) * treatment/family 84 28 1.3564 0.88735 0.031691 0.33105
## Total 113 2.6804
## F Z P Pr(>F)
## coords ~ log(Csize) (Null)
## coords ~ log(Csize) * family 1.7346 1.4656 0.070
## coords ~ log(Csize) * treatment/family 1.9625 2.9528 0.003
## Total
```

One might ascertain that models that include paramaters for family and treatment are significant improvements over a model that only contains size. **Like advanced.procD.lm, one can perform model comparisons, but now one can do that on any number of models with one model serving as the null model for comparisons.** Note that the model fits can use types I, II, or III, sums of squares and cross-products (SSCP), ordinary or generalized least squares, and the ANOVA can be performed on a number of different test statistics (see anova.lm.rrpp help file for more details).

The following analyses replace **procD.allometry**, primarily, and reiterate the enhanced method of multiple model comparisons. First, let’s just consider the simple allometry model

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on SS distributions
##
## Df SS MS Rsq F Z Pr(>SS)
## log(Csize) 1 0.43661 0.43661 0.16289 21.794 3.4677 0.001 **
## Residuals 112 2.24377 0.02003 0.83711
## Total 113 2.68038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize), data = gdf, print.progress = FALSE)
```

It is clear that there is a significant association between shape and size. To visualize this relationship, there are many options. First, we can use the **plot** generic for procD.lm and vary some of the arguments. Let’s do that, using two different ways to visualize shape change: prediction lines (PredLine) and regression scores (RegScore). The former are first principal component scores for fitted values from the procD.lm fit (Adams and Nistri 2010); the latter are standardized projected shape scores, along the axis defined by the regression of shape on size (Drake and Klingenberg 2008). These plot options were formerly found in plot.procD.allometry, as well as plot.procD.lm (as shown below).

The plot.procD.lm function is for any procD.lm fit. If one wishes to work specifically with allometry models, the **plotAllometry** function performs the same analysis as a convenient wrapper for plot.procD.lm. For example,

We could also perform a two-block partial least squares (PLS) analysis to find the correaltion between shape and size, which is not based on a particular model.

```
##
## Call:
## two.b.pls(A1 = log(gdf$Csize), A2 = gdf$coords, print.progress = FALSE)
##
##
##
## r-PLS: 0.475
##
## P-value: 0.001
##
## Effect Size: 6.7227
##
## Based on 1000 random permutations
```

An astute observer might catch that the PLS plot is exactly the same as the RegScore plot. It is, in this case of a simple allometry model. They are also both the same as a plot of the common allometric component (CAC, Mitteroecker et al. 2004); i.e.,

The CAC plot will always be the same as the PLS plot, irrespective of the type of shape-allometry model. The RegScore plot is the same in this simple case because only one vector of regression coefficients is produced, which aligns perfectly with the major axis of covariation between shape and size (the CAC or the shape PLS vector; Adams et al. 2013)

One can also append a size vector to a matrix of shape variables and perform principal components analysis (PCA), called size-shape PCA (Mitteroecker et al. 2004).

We already learned that family and treatment were “significant” model effects. Now let’s focus on whether we should believe that families or treatments have unique allometries or a common allometry

```
fit.unique <- procD.lm(coords ~ log(Csize) * treatment/family,
data = gdf, print.progress = FALSE) # unique allometries
fit.common <- procD.lm(coords ~ log(Csize) + treatment/family,
data = gdf, print.progress = FALSE) # common allometry
anova(fit.common, fit.unique, print.progress = FALSE)
```

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Effect sizes (Z) based on F distributions
##
## ResDf Df RSS SS MS
## coords ~ log(Csize) + treatment/family (Null) 89 1 1.4217
## coords ~ log(Csize) * treatment/family 84 5 1.3564 0.065299 0.01306
## Total 113 2.6804
## Rsq F Z P
## coords ~ log(Csize) + treatment/family (Null) 0.000000
## coords ~ log(Csize) * treatment/family 0.024362 0.8088 -0.20697 0.601
## Total
## Pr(>F)
## coords ~ log(Csize) + treatment/family (Null)
## coords ~ log(Csize) * treatment/family
## Total
```

The ANOVA above was formerly carried out by advanced.procD.lm as a homogeneity of slopes (HOS) test in the function procD.allometry (although nested effects were not possible.) Because this model comparison did not yield a significant result, we can conlude that a common allometry model is appropriate. Thus, we might want to plot the results, color-coding the points by treatment

```
plotAllometry(fit.common, size = gdf$Csize, logsz = TRUE, method = "PredLine",
pch = 19, col = as.numeric(gdf$treatment))
```

```
plotAllometry(fit.common, size = gdf$Csize, logsz = TRUE, method = "RegScore",
pch = 19, col = as.numeric(gdf$treatment))
```

The next section focuses on ANOVA for model effects and pairwise comparisons.

In our example, we have both fixed and random effects. Treatment is a fixed effect and family is a random effect, nested within our fixed effect (as egg clutches were “randomly”" sampled from the wild). Generally, when evaluating model effects, ANOVA involves assessing the probability of observed F-values which are ratios of mean squared (MS) values for effects to MS values for the appropriate random effect, usually the residuals. (For procD.lm models, the distribution of F-values is generated over many random permutations.) For example,

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on F distributions
##
## Df SS MS Rsq F Z Pr(>F)
## log(Csize) 1 0.43661 0.43661 0.16289 27.3316 3.8211 0.001 **
## treatment 5 0.41129 0.08226 0.15344 5.1494 3.5929 0.001 **
## treatment:family 18 0.41076 0.02282 0.15325 1.4285 1.4435 0.071 .
## Residuals 89 1.42172 0.01597 0.53042
## Total 113 2.68038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize) + treatment/family, data = gdf,
## print.progress = FALSE)
```

Notice that the F-value for the three effects - log(Csize), Treatment, and Treament:Family - is calculated as MS effect / MS Residuals. This is the default. However, in our mixed-model ANOVA, we would prefer to calculate the F-value for treatment as MS Treatment / MS Treatment:Family, to determine if the treatment effect is meaningful compared to shape variation among families we sampled randomly and assigned to treatments. We can update our ANOVA by specifying what the denominator (error term) should be, as a sequence of error terms for the ANOVA; e.g.,

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Sums of Squares and Cross-products: Type I
## Effect sizes (Z) based on F distributions
##
## Df SS MS Rsq F Z Pr(>F)
## log(Csize) 1 0.43661 0.43661 0.16289 27.3316 3.8211 0.001 **
## treatment 5 0.41129 0.08226 0.15344 3.6047 2.1110 0.016 *
## treatment:family 18 0.41076 0.02282 0.15325 1.4285 1.4435 0.071 .
## Residuals 89 1.42172 0.01597 0.53042
## Total 113 2.68038
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Call: procD.lm(f1 = coords ~ log(Csize) + treatment/family, data = gdf,
## print.progress = FALSE)
```

Notice the F-value and effect size decreased a bit with recalculation of the F-value for treatment, but remained significant. What this function did was recalculate every treatment F-value in every random permutation to generate a new distribution for measuring effect size (Z) and P-value.

This same procedure was accomplished with the nested.update function in geomorph 3.0.7, but was limited to one term nested within another. The anova function with error argument presented here can work on any number of random effects and interactions, allowing much more complex models to be evaluated!

Now that we know that shape covaries with size, but in a common way for each treatment, we might wish to compare treatment least-squares (LS) means to see which treatments differ in shape, accounting for allometry and accounting for family effects. In geomorph 3.0.7, this was accomplished with advanced.procD.lm. In geomorph 3.1.0, we use the **pairwise** function from *RRPP*. There are several advantages to using the pairwise function. The most prominent are: (1) the ability to quickly change among different test types and summaries without re-analysis, (2) alternative summary options, (3) an option to use grouping variables not included in the original model fit, and (4) much faster computation for straightforward tests.

The pairwise function has this general format:

pairwise(fit, groups, covariate),

where fit is an already fitted object, using procD.lm, groups is a factor to designate groups to be compared, and covariate is a vector if slopes are to be compared. This format assumes the inherent null model of “fit” is appropriate. If an alternative null model is desired, the function can be updated as:

pairwise(fit, fit.null, groups, covariate),

where fit.null is a second procD.lm fit. If one is not sure about the inherent null model, they can use the **reveal.model.designs** function of *RRPP* to discover the eaxt null model used; e.g.,

```
## Reduced
## log(Csize) 1
## treatment log(Csize)
## treatment:family log(Csize) + treatment
## Full
## log(Csize) log(Csize)
## treatment log(Csize) + treatment
## treatment:family log(Csize) + treatment + treatment:family
##
## log(Csize)
## treatment
## treatment:family <- Null/Full inherent in pairwise
```

The results tell us that if we run pairwise on fit.common, the null model would be ~ log(Csize) + treatment and the full model would be ~ log(Csize) + treatment + treatment:family. This is the case because we used type I (sequential) sums of squares and cross-products (the default). However, it is maybe not ideal. We might prefer to have as a null model, ~ log(Csize) + family. Thus, let’s first establish that model and then run the pairwise function

```
fit.null <- procD.lm(coords ~ log(Csize) + family, data = gdf, print.progress = FALSE)
PW <- pairwise(fit.common, fit.null, groups = gdf$treatment, print.progress = FALSE)
PW
```

```
##
## Pairwise comparisons
##
## Groups: AG AM CF CI TG TM
##
## RRPP: 1000 permutations
```

There are now many options for summarizing results; i.e., we can perform multiple tests! Here is one option:

```
##
## Pairwise comparisons
##
## Groups: AG AM CF CI TG TM
##
## RRPP: 1000 permutations
##
## LS means:
## Vectors hidden (use show.vectors = TRUE to view)
##
## Pairwise distances between means, plus statistics
## d UCL (95%) Z Pr > d
## AG:AM 0.03001097 0.07714536 -0.4773728 0.593
## AG:CF 0.06597908 0.08157185 1.2586316 0.121
## AG:CI 0.11545331 0.08320049 3.5978280 0.005
## AG:TG 0.10541209 0.07701231 3.4943277 0.005
## AG:TM 0.06314779 0.08220984 1.1360819 0.131
## AM:CF 0.05613970 0.08207942 0.7370220 0.205
## AM:CI 0.11629452 0.08271685 3.5461717 0.006
## AM:TG 0.10831752 0.08128839 3.4368679 0.005
## AM:TM 0.04811317 0.07981198 0.4075330 0.256
## CF:CI 0.12416405 0.07690531 4.4227467 0.003
## CF:TG 0.13052395 0.07917776 4.6503043 0.001
## CF:TM 0.06013557 0.08236155 0.9118321 0.182
## CI:TG 0.04758571 0.08269126 0.2600663 0.333
## CI:TM 0.15838811 0.08733252 5.1657741 0.001
## TG:TM 0.15048176 0.07878799 5.7108345 0.001
```

The test statistics used, “dist”, is the distance between LS means. By specifying a confidence level, we are given upper confidence limits (UCL) from the distributions of pairwise distances. We can see that if the observed distance is larger than the UCL, the P-value is less than 1 - confidence; i.e., it is “significant”. The default is this “stats table”, but we could also produce pairwise tables. In fact, we can reproduce the old format for advanced.procD.lm like so:

```
##
## Analysis of Variance, using Residual Randomization
## Permutation procedure: Randomization of null model residuals
## Number of permutations: 1000
## Estimation method: Ordinary Least Squares
## Effect sizes (Z) based on F distributions
##
## ResDf Df RSS SS MS Rsq
## coords ~ log(Csize) + family (Null) 109 1 2.0634 0.00000
## coords ~ log(Csize) + treatment/family 89 20 1.4217 0.64165 0.032083 0.23939
## Total 113 2.6804
## F Z P Pr(>F)
## coords ~ log(Csize) + family (Null)
## coords ~ log(Csize) + treatment/family 2.0084 2.7653 0.007
## Total
```

```
##
## Pairwise comparisons
##
## Groups: AG AM CF CI TG TM
##
## RRPP: 1000 permutations
##
## LS means:
## Vectors hidden (use show.vectors = TRUE to view)
##
## Pairwise distances between means
## AG AM CF CI TG TM
## AG 0.00000000 0.03001097 0.06597908 0.11545331 0.10541209 0.06314779
## AM 0.03001097 0.00000000 0.05613970 0.11629452 0.10831752 0.04811317
## CF 0.06597908 0.05613970 0.00000000 0.12416405 0.13052395 0.06013557
## CI 0.11545331 0.11629452 0.12416405 0.00000000 0.04758571 0.15838811
## TG 0.10541209 0.10831752 0.13052395 0.04758571 0.00000000 0.15048176
## TM 0.06314779 0.04811317 0.06013557 0.15838811 0.15048176 0.00000000
##
## Pairwise 95% upper confidence limits between means
## AG AM CF CI TG TM
## AG 0.00000000 0.07714536 0.08157185 0.08320049 0.07701231 0.08220984
## AM 0.07714536 0.00000000 0.08207942 0.08271685 0.08128839 0.07981198
## CF 0.08157185 0.08207942 0.00000000 0.07690531 0.07917776 0.08236155
## CI 0.08320049 0.08271685 0.07690531 0.00000000 0.08269126 0.08733252
## TG 0.07701231 0.08128839 0.07917776 0.08269126 0.00000000 0.07878799
## TM 0.08220984 0.07981198 0.08236155 0.08733252 0.07878799 0.00000000
##
## Pairwise effect sizes (Z) between means
## AG AM CF CI TG TM
## AG 0.0000000 -0.4773728 1.2586316 3.5978280 3.4943277 1.1360819
## AM -0.4773728 0.0000000 0.7370220 3.5461717 3.4368679 0.4075330
## CF 1.2586316 0.7370220 0.0000000 4.4227467 4.6503043 0.9118321
## CI 3.5978280 3.5461717 4.4227467 0.0000000 0.2600663 5.1657741
## TG 3.4943277 3.4368679 4.6503043 0.2600663 0.0000000 5.7108345
## TM 1.1360819 0.4075330 0.9118321 5.1657741 5.7108345 0.0000000
##
## Pairwise P-values between means
## AG AM CF CI TG TM
## AG 1.000 0.593 0.121 0.005 0.005 0.131
## AM 0.593 1.000 0.205 0.006 0.005 0.256
## CF 0.121 0.205 1.000 0.003 0.001 0.182
## CI 0.005 0.006 0.003 1.000 0.333 0.001
## TG 0.005 0.005 0.001 0.333 1.000 0.001
## TM 0.131 0.256 0.182 0.001 0.001 1.000
```

Because we have already performed the pairwise procedure, we could also summarize a different test. For example, let’s say we wish to compare morphological disparities (variances) among treatments. We simply change the summary:

```
##
## Pairwise comparisons
##
## Groups: AG AM CF CI TG TM
##
## RRPP: 1000 permutations
##
##
## Observed variances by group
##
## AG AM CF CI TG TM
## 0.011874974 0.012877162 0.015353706 0.013874109 0.008877628 0.011864619
##
## Pairwise distances between variances, plus statistics
## d UCL (95%) Z Pr > d
## AG:AM 1.002188e-03 0.007953152 -0.92066897 0.795
## AG:CF 3.478732e-03 0.007902216 0.09679327 0.393
## AG:CI 1.999135e-03 0.008248883 -0.54000810 0.636
## AG:TG 2.997346e-03 0.007976495 -0.12473012 0.480
## AG:TM 1.035474e-05 0.007725257 -1.32184888 0.998
## AM:CF 2.476544e-03 0.007846256 -0.36485927 0.571
## AM:CI 9.969467e-04 0.008096110 -0.91076127 0.807
## AM:TG 3.999534e-03 0.007839119 0.31833729 0.315
## AM:TM 1.012543e-03 0.008067819 -0.90505752 0.811
## CF:CI 1.479597e-03 0.008331368 -0.77170875 0.746
## CF:TG 6.476078e-03 0.008039605 1.24127000 0.120
## CF:TM 3.489087e-03 0.008154923 0.05868425 0.405
## CI:TG 4.996481e-03 0.008588026 0.58161946 0.261
## CI:TM 2.009489e-03 0.008205385 -0.50494354 0.618
## TG:TM 2.986991e-03 0.008601876 -0.14667254 0.468
```

This should be exactly the same as performing a morphological disparity test

```
##
## Call:
## morphol.disparity(f1 = fit.common, groups = gdf$treatment, print.progress = FALSE)
##
##
##
##
## Randomized Residual Permutation Procedure Used
## 1000 Permutations
##
## Procrustes variances for defined groups
## AG AM CF CI TG TM
## 0.011874974 0.012877162 0.015353706 0.013874109 0.008877628 0.011864619
##
##
## Pairwise absolute differences between variances
## AG AM CF CI TG TM
## AG 0.000000e+00 0.0010021880 0.003478732 0.0019991346 0.002997346 1.035474e-05
## AM 1.002188e-03 0.0000000000 0.002476544 0.0009969467 0.003999534 1.012543e-03
## CF 3.478732e-03 0.0024765442 0.000000000 0.0014795975 0.006476078 3.489087e-03
## CI 1.999135e-03 0.0009969467 0.001479597 0.0000000000 0.004996481 2.009489e-03
## TG 2.997346e-03 0.0039995339 0.006476078 0.0049964806 0.000000000 2.986991e-03
## TM 1.035474e-05 0.0010125427 0.003489087 0.0020094894 0.002986991 0.000000e+00
##
##
## P-Values
## AG AM CF CI TG TM
## AG 1.000 0.795 0.393 0.636 0.480 0.998
## AM 0.795 1.000 0.571 0.807 0.315 0.811
## CF 0.393 0.571 1.000 0.746 0.120 0.405
## CI 0.636 0.807 0.746 1.000 0.261 0.618
## TG 0.480 0.315 0.120 0.261 1.000 0.468
## TM 0.998 0.811 0.405 0.618 0.468 1.000
```

The **pairwise** function in *RRPP* is really versatile and far less cumbersome than advanced.procD.lm was. More examples are provided in the help file for the function, and greater detail for how to summarize different tests is found in the summary.pairwise help file.

The trajectory,analysis function has been modified and now resides in *RRPP*, as it is a wrapper for the **pairwise** function. It has the same basic arguments as the pairwise function, but also has an argument for trajectory points (which can be a single value, if data are already trajectories or a factor to indicate trajectory point levels). Following the example above, trajectory analysis can be considered a pairwise function where treatments are trajectories and families are trajectory points. The following highlights the steps involved for one type of example (but the plotting options are quite numerous):

```
TA <- trajectory.analysis(fit.common,
groups = gdf$treatment, traj.pts = gdf$family,
pca = TRUE, print.progress = FALSE)
summary(TA, attribute = "MD")
```

```
##
## Trajectory analysis
##
## 1000 permutations.
##
## Points projected onto trajectory PCs
##
## Trajectories:
## Trajectories hidden (use show.trajectories = TRUE to view)
##
## Observed path distances by group
##
## AG AM CF CI TG TM
## 0.2123713 0.1913723 0.6012434 0.2281477 0.2244251 0.1659620
##
## Pairwise absolute differences in path distances, plus statistics
## d UCL (95%) Z Pr > d
## AG:AM 0.020999022 0.1929450 -0.8775444 0.799
## AG:CF 0.388872085 0.2116862 4.6686344 0.001
## AG:CI 0.015776442 0.2156852 -0.9548828 0.867
## AG:TG 0.012053773 0.2088421 -1.0675309 0.894
## AG:TM 0.046409314 0.1961801 -0.4994971 0.621
## AM:CF 0.409871106 0.2086858 5.1311334 0.001
## AM:CI 0.036775464 0.2046494 -0.6586203 0.697
## AM:TG 0.033052795 0.2057121 -0.7547284 0.747
## AM:TM 0.025410293 0.2092605 -0.8089060 0.771
## CF:CI 0.373095642 0.2103914 4.2824033 0.002
## CF:TG 0.376818311 0.2192778 4.3244197 0.001
## CF:TM 0.435281399 0.2169419 5.1923142 0.001
## CI:TG 0.003722669 0.2057353 -1.2096126 0.974
## CI:TM 0.062185757 0.2215613 -0.3493108 0.537
## TG:TM 0.058463088 0.2149084 -0.3208141 0.519
```

```
TP <- plot(TA, pch = 19, cex = 0.7, col = as.numeric(gdf$treatment))
add.trajectories(TP, traj.bg = 1:nlevels(gdf$treatment),
start.bg = 1:nlevels(gdf$treatment),
end.bg = 1:nlevels(gdf$treatment))
```

The argument, attribute = “MD”, indicates that the differences between trajectory magnitudes - the path length of trajectories - is considered. The trajectory analysis could also be summarized for trajectory correlations (TC), which are angles between trajectory directions (major axes of variation), or shape differences (SD). More examples are given in the **trajectory.analysis** help file. The plotting options for trajectory.analysis in geomorph 3.0.7 were somewhat constrained but have been enhanced in *RRPP*. The function, plot.trajectory.analysis plots the data points projected on the PCs for fitted values and the function, add.trajectories, superimposes the trajectories on these points. The help files for these functions have further details.

This vignette hopefully illustrates that the goals of former functions - advanced.procD.lm, procD.allometry, and nested.update - are as easily accomplished with alternative functions that have fewer constraints. If you are new to geomorph, then this vignette should give you some ideas for how to analyze data with pairwise comparisons.

Levis, N.A, M.L. Schooler, J.R. Johnson, and M.L. Collyer. 2016. The effects of terrestrial and aquatic herbicides on larval salamander morphology and swim speed. Biological Journal of the Linnean Society. 118:569-581.

Adams, D. C., and A. Nistri. 2010. Ontogenetic convergence and evolution of foot morphology in European cave salamanders (Family: Plethodontidae). BMC Evol. Biol. 10:1-10.

Adams, D.C., F.J. Rohlf, and D.E. Slice. 2013. A field comes of age: geometric morphometrics in the 21st century. Hystrix. 24:7-14.

Drake, A. G., and C. P. Klingenberg. 2008. The pace of morphological change: Historical transformation of skull shape in St Bernard dogs. Proc. R. Soc. B. 275:71-76.

Mitteroecker, P., P. Gunz, M. Bernhard, K. Schaefer, and F. L. Bookstein. 2004. Comparison of cranial ontogenetic trajectories among great apes and humans. J. Hum. Evol. 46:679-698.

Rohlf, F.J., and M. Corti. 2000. The use of partial least-squares to study covariation in shape. Systematic Biology 49: 740-753.