There are several ways this could be done. Below is script for one way, using the larvalMorph data set (which has separate configurations of heads and tails, originally digitized together is same images).
library(geomorph)
data("larvalMorph")
n <- length(larvalMorph$family)
# 1, get mean locations
headmeans <- colMeans(larvalMorph$headcoords)
tailmeans <- colMeans(larvalMorph$tailcoords)
# 2, separate GPAs
headGPA <- gpagen(larvalMorph$headcoords,
curves = larvalMorph$head.sliders,
PrinAxes = FALSE)
tailGPA <- gpagen(larvalMorph$tailcoords,
curves = larvalMorph$tail.sliders,
PrinAxes = FALSE)
# 3, rescale configurations
headcoords <- headGPA$coords
headsize <- headGPA$Csize
for(i in 1:n) headcoords[,,i] <- headcoords[,,i] * headsize[i]
tailcoords <- tailGPA$coords
tailsize <- tailGPA$Csize
for(i in 1:n) tailcoords[,,i] <- tailcoords[,,i] * tailsize[i]
# 4, add back the mean locations
for(i in 1:n) headcoords[,,i] <-
t(t(headcoords[,,i]) + headmeans[, i])
for(i in 1:n) tailcoords[,,i] <-
t(t(tailcoords[,,i]) + tailmeans[,i])
# 5, combine landmark sets
coords <- list()
for(i in 1:n) coords[[i]] <- rbind(headcoords[,,i], tailcoords[,,i])
names(coords) <- dimnames(larvalMorph$headcoords)[[3]]
coords <- simplify2array(coords)
# 6, GPA of combined sets
GPA <- gpagen(coords)
plot(GPA)
Here is a plot of the result
So, in this example, head sliders only applied to heads and tail sliders only to tails, meaning a bending energy matrix did not have to be created that included both heads and tails (so landmarks in the head had no effect on the tails and vice versa). One might call this localized sliding.
Also, I should note that although this is better than using original configurations (see Collyer et al. 2020, Fig 1), for this particular example, it would be better to align the configurations separately, because the spatial relationships between heads and tails is not fixed. This is why we have the combine.subsets function, which can make a composite of separate alignments but does not preserve sub-configuration locations.
Hope this helps!
Mike
Collyer, M. L., Davis, M. A., & Adams, D. C. (2020). Making heads or tails of combined landmark configurations in geometric morphometric data. Evolutionary Biology, 47, 193-205.