我一直在尝试使用qgraph
来生成网络图。代码如下
Gw <- qgraph(edgeList, diag = TRUE, labels = TRUE,legend.cex = 0.3, vsize = 1,edge.color=colorLabels,legend=TRUE,asize=1)
可以生成图形,但R命令行会显示以下错误消息。我不知道invalid color name 'background'
是什么意思。
dput
结果显示如下,
dput(EdgeList都) 结构(c(&#34; 1&#34;,&#34; 2&#34;,&#34; 2&#34;,&#34; 3&#34;,&#34; 4&#34;,& #34; 5&#34;,&#34; 6&#34;,&#34; 7&#34;,&#34; 8&#34;,&#34; 1&#34;, &#34; 9&#34;,&#34; 10&#34;,&#34; 11&#34;,&#34; 12&#34;,&#34; 13&#34;,&#34; 14& #34;,&#34; 15&#34;,&#34; 16&#34;,&#34; 17&#34;,&#34; 18&#34;,&#34; 16&#34;, &#34; 4&#34;,&#34; 5&#34;,&#34; 7&#34;,&#34; 1&#34;,&#34; 9&#34;,&#34; 10& #34;,&#34; 19&#34;,&#34; 20&#34;,&#34; 2&#34;,&#34; 16&#34;,&#34; 21&#34;,& #34; 3&#34 ;, &#34; 22&#34;,&#34; 5&#34;,&#34; 23&#34;,&#34; 8&#34;,&#34; 1&#34;,&#34; 20& #34;,&#34; 2&#34;,&#34; 13&#34;,&#34; 14&#34;,&#34; 17&#34;,&#34; 14&#34;, &#34; 1&#34;,&#34; 19&#34;,&#34; 14&#34;,&#34; 2&#34;,&#34; 21&#34;,&#34; 14& #34;,&#34; 24&#34;,&#34; 1&#34;,&#34;:499.3&#34;,&#34; nk Transfe&#34;, &#34; de of tran&#34;,&#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非美国和#) 34;,&#34; up(非美国&#34;, &#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非) US&#34;,&#34; up(非美国&#34;, &#34; ine:4121&#34;,&#34; ine:3257.4&#34;,&#34; ine:75.2&#34;,&#34; ine:75.2&#34;,&#34 ; INE:11615&#34 ;, &#34; ine:10603&#34;,&#34; ine:334.2&#34;,&#34; ine:7256.8&#34;,&#34; ine:7256.8&#34;,&#34 ; INE:996.8&#34 ;, &#34; ine:884.6&#34;,&#34; ine:364.9&#34;,&#34; ine:6360&#34;,&#34; ine:5640.9&#34;,&#34 ; INE:2729.7&#34 ;, &#34; ine:5482.6&#34;,&#34; ine:85&#34;,&#34; ine:1474.9&#34;,&#34; ine:700.8&#34;,&#34 ; INE:2754.6&#34 ;, &#34; ine:3257.4&#34;,&#34; ine:3257.4&#34;,&#34; ine:7307.8&#34;,&#34; ine:18560。&#34;,& #34; INE:85.1&#34 ;, &#34; ine:364.8&#34;,&#34;:700.1&#34;,&#34;:5317&#34;,&#34; l:4258.9&#34;,&#34; l :4258.9&#34;,&#34; l:1637.6&#34;, &#34; l:1637.6&#34;,&#34; l:46.4&#34;,&#34; l:3938.5&#34;,&#34; l:3938.5&#34;,&# 34; l:2800.4&#34;,&#34; l:2715.1&#34;, &#34; l:2715.1&#34;,&#34; l:12708.2&#34;,&#34; l:1042&#34;,&#34;:499.3&#34;,&#34; nk Transfe&#34;,&#34; de of tran&#34;, &#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非) US&#34;,&#34; up(非美国&#34;, &#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非美国&#34;,&#34; up(非) US&#34;,&#34; ine:4121&#34;, &#34; ine:3257.4&#34;,&#34; ine:75.2&#34;,&#34; ine:75.2&#34;,&#34; ine:11615。&#34;,& #34; INE:10603&#34 ;, &#34; ine:334.2&#34;,&#34; ine:7256.8&#34;,&#34; ine:7256.8&#34;,&#34; ine:996.8&#34;,&# 34; INE:884.6&#34 ;, &#34; ine:364.9&#34;,&#34; ine:6360&#34;,&#34; ine:5640.9&#34;,&#34; ine:2729.7&#34;,&#34 ; INE:5482.6&#34 ;, &#34; ine:85&#34;,&#34; ine:1474.9&#34;,&#34; ine:700.8&#34;,&#34; ine:2754.6&#34;,&#34 ; INE:3257.4&#34 ;, &#34; ine:3257.4&#34;,&#34; ine:7307.8&#34;,&#34; ine:18560。&#34;,&#34; ine:85.1&#34;,& #34; INE:364.8&#34 ;, &#34;:700.1&#34;,&#34;:5317&#34;,&#34; l:4258.9&#34;,&#34; l:4258.9&#34;,&#34; l :1637.6&#34;,&#34; l:1637.6&#34;, &#34; l:46.4&#34;,&#34; l:3938.5&#34;,&#34; l:3938.5&#34;,&#34; l:2800.4&#34;,&# 34; l:2715.1&#34;,&#34; l:2715.1&#34;, &#34; l:12708.2&#34;,&#34; l:1042&#34;,&#34; 25&#34;,&#34; 1&#34;,&#34; 1&#34;, &#34; 26&#34;,&#34; 27&#34;,&#34; 28&#34;,&#34; 29&#34;, &#34; 30&#34;,&#34; 31&#34;,&#34; 25&#34;,&#34; 32&#34;,&#34; 33&#34;,&#34; 4& #34;,&#34; 4&#34;,&#34; 3&#34;,&#34; 3&#34;,&#34; 5&#34;,&#34; 5&#34;,& #34; 7&#34 ;, &#34; 6&#34;,&#34; 6&#34;,&#34; 27&#34;,&#34; 28&#34;,&#34; 30&#34;,&#34; 25& #34;,&#34; 32&#34;,&#34; 33&#34;,&#34; 9&#34;,&#34; 8&#34;,&#34; 1&#34;, &#34; 1&#34;,&#34; 10&#34;,&#34; 12&#34;,&#34; 12&#34;,&#34; 16&#34;,&#34; 16& #34;,&#34; 16&#34;,&#34; 16&#34;,&#34; 8&#34;,&#34; 1&#34;,&#34; 3&#34;, &#34; 3&#34;,&#34; 7&#34;,&#34; 7&#34;,&#34; 25&#34;,&#34; 9&#34;,&#34; 9& #34;,&#34; 1&#34;,&#34; 10&#34;,&#34; 10&#34;,&#34; 14&#34;,&#34; 14&#34;), .Dim = c(104L, 2L),.。Dimnames = list(NULL,c(&#34; newsendId&#34;,&#34; newtoId&#34;)))
生成的数字如下。我使用以下命令生成它
Gw <- qgraph(edgeList, layout = "spring", diag = FALSE, labels = TRUE, cut = NULL, edge.color = "red",legend.cex = 0.5, vsize = 8)
答案 0 :(得分:0)
哪些节点有问题?使用您的数据和代码,您可以修改label.cex.
标签和图例大小的参数还有其他变体。这是一个版本,颜色为蓝色。
library(qgraph)
Gw <- qgraph(edgeList, layout = "spring", diag = FALSE, labels = TRUE, cut = NULL, edge.color = "red", legend.cex = 0.3, vsize = 4, label.cex = 0.3, label.color = "blue")
Gw