SachaEpskamp / qgraph

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

issue with centralityTable () #25

Closed JolandaKossakowski closed 5 years ago

JolandaKossakowski commented 5 years ago

The latest version of qgraph returns an error when I want to compute the raw centrality measures, or if I want to include certain centrality measures.

MWE:

library(psych) library(qgraph) library(bootnet)

data(bfi) bfiSub <- bfi[,1:25]

Estimate network:

Network <- estimateNetwork(bfiSub, default = "EBICglasso") centralityTable(Network) # works centralityTable(Network, scale = "raw") #error : Error in UseMethod("getWmat") : no applicable method for 'getWmat' applied to an object of class "character" centralityTable(Network, include = c("Strength")) # same error are above

SachaEpskamp commented 5 years ago

Hi Jolanda,

Both scale and include are arguments to centralityPlot not centralityTable, which now treats these as networks leading to the error. In centralityTable the argument standardized = FALSE can be used. It will return all centrality indices, and you can filter them manually afterward (e.g., using dplyrs filter function).

JolandaKossakowski commented 5 years ago

would be awesome if the error could reflect this in a future update!