R: adding advanced example PCA