Learn R Programming

Morpho (version 2.12)

predict.bgPCA: Compute between-group-PC scores from new data

Description

Compute between-group-PC scores from new data

Usage

# S3 method for bgPCA
predict(object, newdata, ...)

Value

returns the between-group-PC scores for new data

Arguments

object

object of class bgPCA returned from groupPCA

newdata

matrix or 3D array containing data in the same format as originally used to compute groupPCA

...

currently not used.

Examples

Run this code
data(boneData)

boneLMPart <- boneLM[,,-(1:2)]
procPart <- procSym(boneLMPart)
pop_sex <- name2factor(boneLMPart, which=3:4)
## compute group PCA without first 2 specimens
gpcaPart <- groupPCA(procPart$orpdata, groups=pop_sex, rounds=0, mc.cores=2,cv=FALSE)
## align new data to Procrustes analysis
newdata <- align2procSym(procPart,boneLM[,,1:2])
## get scores for new data
newscores <- predict(gpcaPart,newdata)

Run the code above in your browser using DataLab