# Can you create an eigencor() plot with IPCA?

Hi everyone! I am running a PCA using the PCAtools package and I want to compare the results to the IPCA function in mixOmics. One of the things I would like to do is create an eigencor() plot using Pearson Correlation.

From the PCAtools GitHub it looks like this:

``````eigencorplot(p,
components = getComponents(p, 1:horn\$n),
metavars = c('Study','Age','Distant.RFS','ER','GGI',
col = c('white', 'cornsilk1', 'gold', 'forestgreen', 'darkgreen'),
cexCorval = 1.2,
fontCorval = 2,
posLab = 'all',
rotLabX = 45,
scale = TRUE,
main = bquote(Principal ~ component ~ Pearson ~ r^2 ~ clinical ~ correlates),
plotRsquared = TRUE,
corFUN = 'pearson',
corUSE = 'pairwise.complete.obs',
corMultipleTestCorrection = 'BH',
signifSymbols = c('****', '***', '**', '*', ''),
signifCutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1))
``````

I would like to try and create a graph like this with the IPCA object generated. Is there any way we can make that happen?

Thanks!

I had a quick look at PCAtools and I don’t think it would be too hard to do if you can hack the function or plot it similarly.

Basically you need to extract the variates from your IPCA and then calculate the Pearson correlation with each of the clinical variables. I am tempted to say: ask chatGPT for a template

Kim-Anh

Thank you for taking the time! I was thinking that maybe taking the variates would be the course of action but I think I was just staring too long at the PCA vs IPCA objects

I am tempted to look at chatGTP as well, but I haven’t had luck with them and R coding. But it’s always worth a shot!

Thanks again!

Emily (@Jatbee32)