MomX / Momocs

:dove: Morphometrics using R
http://momx.github.io/Momocs/
51 stars 18 forks source link

PC.contrib should return a list of reconstructed shapes #167

Closed vbonhomme closed 7 years ago

vbonhomme commented 7 years ago

as proposed by J.J Hill. so far we still can do such a thing:

library(Momocs)

data(bot)
bot.p <- PCA(efourier(bot, 12))
x <- PCcontrib(bot.p)
# all reconstructed shapes  are in the ggplot2's $data
x$data %>% 
  # we dont want all columns
  select(x=x_c, y=y_c, shp1, nax) %>% 
  # we split for each pair of nax x shp1
  split(f=list(.$shp1, .$nax)) %>% 
  # you can stop here or continue to a panel
  Out() %>% panel()

## Triple check the order of shapes what you obtain !