SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

PCA not working #33

Closed xmarti6 closed 5 years ago

xmarti6 commented 5 years ago

Hi, congrats for the packages, I've tested PCA, but PCA example is not working anymore probably due to psych package update:

> R.version
version.string R version 3.6.1 (2019-07-05)
> packageVersion("psych")
[1] ‘1.8.12’
> packageVersion("qgraph")
[1] ‘1.6.3’
> data(big5)
>  big5pca <- principal(cor(big5), 5, rotate = "promax")
> isCorrelation(big5pca)
[1] FALSE
>   qgraph(big5pca)
Error in qgraph(big5pca) : Input is not a weights matrix or an edgelist.
xmarti6 commented 5 years ago

Seems like now is accessed via "$loadings"

big5pca <- principal(cor(big5), 5, rotate = "promax")
qgraph(big5pca$loadings, groups = big5groups, layout = "circle", rotation = "promax", 
    minimum = 0.2, cut = 0.4, vsize = c(1.5, 15), borders = FALSE, vTrans = 200)