library(shapes)
proc <- procSym(gorf.dat)
##get weights for the the four specimen closest to the first observation.
weights <- proc.weight(proc$rotated,4,1)
##estimate the first specimen by weighted neighbour shapes.
estim <- proc$mshape*0;
for (i in 1:4)
{estim <-estim+proc$rotated[,,weights$data$nr[i]]*weights$data$weight[i]}
### visualise
plot(estim,asp=1)## show estimation
points(proc$rotated[,,1],col=3)##show original
Run the code above in your browser using DataLab