Convenience function for plotting shape PCs based on geomorph::plotRefToTarget()
. Other than plotRefToTarget
, magnitude of visualized difference in shape between reference face at average and low/high levels of the respective PC is based on standard deviations (instead of range).
plot_2dpcs( input, ref = NULL, which_pcs = 1:3, vis_sd = 3, print = TRUE, output = NULL )
input | Object of class |
---|---|
ref | Reference face. Defaults to sample average if input is facefuns object |
which_pcs | Which PCs are to be created. Single number or vector, maximum allowed is 5 |
vis_sd | Extent of desired manipulation in units of standard deviation |
Print plot |
|
output | Specify file name/path to save plot |
Returns plot
data(LondonSet_aligned) pca_output <- geomorph::gm.prcomp(LondonSet_aligned) ref <- geomorph::mshape(LondonSet_aligned) plot_2dpcs(pca_output, ref)#> [1] "/var/folders/lh/555rbl4x0yvbf8n6w709q7kh0000gn/T//Rtmpouu1D0/fileeac2d51fa15.png" #> attr(,"class") #> [1] "knit_image_paths" "knit_asis"