R报错
Error in UseMethod("getWmat")
no applicable method for 'getWmat' applied to an object of class "c('gg', 'ggplot')"
检查发现"getWmat"这个函数从各种对象中提取一个权重矩阵。
在代码中输入的对象不是一个矩阵,修正后可以正常运行。
如果你也遇到这个问题,可以检查一下该语句中输入的对象是否正确,是否为矩阵
补充:
getWmat {qgraph}
Obtain a weights matrix
Description
This function extracts a weights matrix from various kinds of objects.
Value
A weights matrix
Author(s)
Sacha Epskamp <mail@sachaepskamp.com>