Once specimens are procrustes aligned and semi-landmarks are slid you can calculate the procrustes distance between landmarks for each specimen's original and mirrored versions.
morton1103ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1103ProcDist[ [i ]] <- sqrt( sum( (morton1103alignedproc[ ,, 2] [i ,] -morton1103alignedproc[ ,, 1] [i ,]) ^2))}
morton1188ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1188ProcDist[ [i ]] <- sqrt( sum( (morton1188alignedproc[ ,, 2] [i ,] -morton1188alignedproc[ ,, 1] [i ,]) ^2))}
morton1192ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1192ProcDist[ [i ]] <- sqrt( sum( (morton1192alignedproc[ ,, 2] [i ,] -morton1192alignedproc[ ,, 1] [i ,]) ^2))}
morton1306ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1306ProcDist[ [i ]] <- sqrt( sum( (morton1306alignedproc[ ,, 2] [i ,] -morton1306alignedproc[ ,, 1] [i ,]) ^2))}
morton1319ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1319ProcDist[ [i ]] <- sqrt( sum( (morton1319alignedproc[ ,, 2] [i ,] -morton1319alignedproc[ ,, 1] [i ,]) ^2))}
morton1329ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1329ProcDist[ [i ]] <- sqrt( sum( (morton1329alignedproc[ ,, 2] [i ,] -morton1329alignedproc[ ,, 1] [i ,]) ^2))}
morton1486ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1486ProcDist[ [i ]] <- sqrt( sum( (morton1486alignedproc[ ,, 2] [i ,] -morton1486alignedproc[ ,, 1] [i ,]) ^2))}
morton1973ProcDist <- rep( NA, 969)
for (i in 1:969) {morton1973ProcDist[ [i ]] <- sqrt( sum( (morton1973alignedproc[ ,, 2] [i ,] -morton1973alignedproc[ ,, 1] [i ,]) ^2))}
morton25ProcDist <- rep( NA, 969)
for (i in 1:969) {morton25ProcDist[ [i ]] <- sqrt( sum( (morton25alignedproc[ ,, 2] [i ,] -morton25alignedproc[ ,, 1] [i ,]) ^2))}
morton413ProcDist <- rep( NA, 969)
for (i in 1:969) {morton413ProcDist[ [i ]] <- sqrt( sum( (morton413alignedproc[ ,, 2] [i ,] -morton413alignedproc[ ,, 1] [i ,]) ^2))}
morton422ProcDist <- rep( NA, 969)
for (i in 1:969) {morton422ProcDist[ [i ]] <- sqrt( sum( (morton422alignedproc[ ,, 2] [i ,] -morton422alignedproc[ ,, 1] [i ,]) ^2))}
morton432ProcDist <- rep( NA, 969)
for (i in 1:969) {morton432ProcDist[ [i ]] <- sqrt( sum( (morton432alignedproc[ ,, 2] [i ,] -morton432alignedproc[ ,, 1] [i ,]) ^2))}
morton434ProcDist <- rep( NA, 969)
for (i in 1:969) {morton434ProcDist[ [i ]] <- sqrt( sum( (morton434alignedproc[ ,, 2] [i ,] -morton434alignedproc[ ,, 1] [i ,]) ^2))}
morton451ProcDist <- rep( NA, 969)
for (i in 1:969) {morton451ProcDist[ [i ]] <- sqrt( sum( (morton451alignedproc[ ,, 2] [i ,] -morton451alignedproc[ ,, 1] [i ,]) ^2))}
morton51ProcDist <- rep( NA, 969)
for (i in 1:969) {morton51ProcDist[ [i ]] <- sqrt( sum( (morton51alignedproc[ ,, 2] [i ,] -morton51alignedproc[ ,, 1] [i ,]) ^2))}
morton547ProcDist <- rep( NA, 969)
for (i in 1:969) {morton547ProcDist[ [i ]] <- sqrt( sum( (morton547alignedproc[ ,, 2] [i ,] -morton547alignedproc[ ,, 1] [i ,]) ^2))}
morton631ProcDist <- rep( NA, 969)
for (i in 1:969) {morton631ProcDist[ [i ]] <- sqrt( sum( (morton631alignedproc[ ,, 2] [i ,] -morton631alignedproc[ ,, 1] [i ,]) ^2))}
morton645ProcDist <- rep( NA, 969)
for (i in 1:969) {morton645ProcDist[ [i ]] <- sqrt( sum( (morton645alignedproc[ ,, 2] [i ,] -morton645alignedproc[ ,, 1] [i ,]) ^2))}
morton646ProcDist <- rep( NA, 969)
for (i in 1:969) {morton646ProcDist[ [i ]] <- sqrt( sum( (morton646alignedproc[ ,, 2] [i ,] -morton646alignedproc[ ,, 1] [i ,]) ^2))}
morton762ProcDist <- rep( NA, 969)
for (i in 1:969) {morton762ProcDist[ [i ]] <- sqrt( sum( (morton762alignedproc[ ,, 2] [i ,] -morton762alignedproc[ ,, 1] [i ,]) ^2))}
morton772ProcDist <- rep( NA, 969)
for (i in 1:969) {morton772ProcDist[ [i ]] <- sqrt( sum( (morton772alignedproc[ ,, 2] [i ,] -morton772alignedproc[ ,, 1] [i ,]) ^2))}
morton778ProcDist <- rep( NA, 969)
for (i in 1:969) {morton778ProcDist[ [i ]] <- sqrt( sum( (morton778alignedproc[ ,, 2] [i ,] -morton778alignedproc[ ,, 1] [i ,]) ^2))}
morton787ProcDist <- rep( NA, 969)
for (i in 1:969) {morton787ProcDist[ [i ]] <- sqrt( sum( (morton787alignedproc[ ,, 2] [i ,] -morton787alignedproc[ ,, 1] [i ,]) ^2))}
morton808ProcDist <- rep( NA, 969)
for (i in 1:969) {morton808ProcDist[ [i ]] <- sqrt( sum( (morton808alignedproc[ ,, 2] [i ,] -morton808alignedproc[ ,, 1] [i ,]) ^2))}
morton901ProcDist <- rep( NA, 969)
for (i in 1:969) {morton901ProcDist[ [i ]] <- sqrt( sum( (morton901alignedproc[ ,, 2] [i ,] -morton901alignedproc[ ,, 1] [i ,]) ^2))}
morton902ProcDist <- rep( NA, 969)
for (i in 1:969) {morton902ProcDist[ [i ]] <- sqrt( sum( (morton902alignedproc[ ,, 2] [i ,] -morton902alignedproc[ ,, 1] [i ,]) ^2))}
morton913ProcDist <- rep( NA, 969)
for (i in 1:969) {morton913ProcDist[ [i ]] <- sqrt( sum( (morton913alignedproc[ ,, 2] [i ,] -morton913alignedproc[ ,, 1] [i ,]) ^2))}
morton915ProcDist <- rep( NA, 969)
for (i in 1:969) {morton915ProcDist[ [i ]] <- sqrt( sum( (morton915alignedproc[ ,, 2] [i ,] -morton915alignedproc[ ,, 1] [i ,]) ^2))}
morton1188ProcDist <- rep
morton1192ProcDist <- rep
morton1306ProcDist <- rep
morton1319ProcDist <- rep
morton1329ProcDist <- rep
morton1486ProcDist <- rep
morton1973ProcDist <- rep
morton25ProcDist <- rep
morton413ProcDist <- rep
morton422ProcDist <- rep
morton432ProcDist <- rep
morton434ProcDist <- rep
morton451ProcDist <- rep
morton51ProcDist <- rep
morton547ProcDist <- rep
morton631ProcDist <- rep
morton645ProcDist <- rep
morton646ProcDist <- rep
morton762ProcDist <- rep
morton772ProcDist <- rep
morton778ProcDist <- rep
morton787ProcDist <- rep
morton808ProcDist <- rep
morton901ProcDist <- rep
morton902ProcDist <- rep
morton913ProcDist <- rep
morton915ProcDist <- rep
ProcDistLandmarks_all_matrix <- matrix(c(morton1103ProcDist,morton1188ProcDist, morton1192ProcDist, morton1306ProcDist, morton1319ProcDist, morton1329ProcDist, morton1486ProcDist, morton1973ProcDist, morton25ProcDist, morton413ProcDist, morton422ProcDist, morton432ProcDist, morton434ProcDist, morton451ProcDist, morton51ProcDist, morton547ProcDist, morton631ProcDist, morton645ProcDist, morton646ProcDist, morton762ProcDist, morton772ProcDist, morton778ProcDist, morton787ProcDist, morton808ProcDist, morton901ProcDist, morton902ProcDist, morton913ProcDist, morton915ProcDist),nrow=length(morton1103ProcDist))
ProcDistLandmarks_all_mean <- apply( ProcDistLandmarks_all_matrix, 1, mean)
ProcDistLandmarks_males <- matrix(c(morton1188ProcDist, morton1306ProcDist, morton1319ProcDist, morton1486ProcDist, morton1973ProcDist, morton413ProcDist, morton432ProcDist, morton434ProcDist, morton645ProcDist, morton762ProcDist, morton772ProcDist, morton808ProcDist, morton901ProcDist, morton915ProcDist),nrow=length(morton1103ProcDist))
ProcDistLandmarks_females <- matrix(c(morton1103ProcDist,morton1192ProcDist, morton1329ProcDist, morton25ProcDist, morton422ProcDist, morton451ProcDist, morton51ProcDist, morton547ProcDist, morton631ProcDist, morton646ProcDist, morton778ProcDist, morton787ProcDist, morton902ProcDist, morton913ProcDist),nrow=length(morton1103ProcDist))
ProcDistLandmarks_males_mean <- apply( ProcDistLandmarks_males, 1, mean)
ProcDistLandmarks_females_mean <- apply( ProcDistLandmarks_females, 1, mean)
No comments:
Post a Comment