# NOT RUN {
# Data matrix of 2D landmark coordinates
data("Tropheus.IK.coord")
coords <- which(names(Tropheus.IK.coord) == "X1"):which(names(Tropheus.IK.coord) == "Y19")
proc.coord <- as.matrix(Tropheus.IK.coord[coords])
# Pooled within-group covariance matrix for all populations (weighted by sample size)
W <- cov.W(proc.coord, groups = Tropheus.IK.coord$POP.ID, weighted = TRUE)
# Pooled within-group covariance matrix for all populations (unweighted)
W <- cov.W(proc.coord, groups = Tropheus.IK.coord$POP.ID)
# Within-group covariance matrix for all populations, pooled by sex
W.mf <- cov.W(proc.coord, groups = Tropheus.IK.coord$POP.ID, sex = Tropheus.IK.coord$Sex)
# }
Run the code above in your browser using DataLab