Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predictRelWarps

predict relative warps for data not included in the training data set


Description

predict relative warps for data not included in the training data set

Usage

predictRelWarps(x, newdata, noalign = FALSE)

Arguments

x

output from relWarps

newdata

k x m x n array holding new landmark data

noalign

logical: if TRUE, data is assumed to be already aligned to training data and alignment is skipped.

Details

This function aligns the new data to the mean from x and transforms it into the relative warp space computed from the training data.

Value

returns a list containing

bescores

relative warp scores (PC-scores if alpha = 0)

uniscores

uniform scores, NULL if alpha = 0

Examples

data(boneData)
set.seed(42)
training <- sample(1:80,size=60)
rW1 <- relWarps(boneLM[,,training], alpha = -1)
## predict scores for the entire sample
predAll <- predictRelWarps(rW1,boneLM)

## now compare the scores predicted scores to the original ones
layout(matrix(1:4,2,2))
for (i in 1:2) {
  plot(rW1$bescores[,i],predAll$bescores[training,i],main=paste("RW",i))
  plot(rW1$uniscores[,i],predAll$uniscores[training,i],main=paste("UC",i))
}

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.