invalid color name background in qgraph

拥有回忆 提交于 2019-12-13 05:28:14

问题


I have been trying to use qgraph to generate the network graph. The code is as following

Gw <- qgraph(edgeList, diag = TRUE, labels = TRUE,legend.cex = 0.3, vsize = 1,edge.color=colorLabels,legend=TRUE,asize=1)

The figure can be generated, but the R command line gives the following error message. I do not know what does the invalid color name 'background' mean.

The dput result is shown as follows,

dput(edgeList) structure(c("1", "2", "2", "3", "4", "5", "6", "7", "8", "1", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "16", "4", "5", "7", "1", "9", "10", "19", "20", "2", "16", "21", "3", "22", "5", "23", "8", "1", "20", "2", "13", "14", "17", "14", "1", "19", "14", "2", "21", "14", "24", "1", ":499.3", "nk Transfe", "de of tran", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "ine:4121", "ine:3257.4", "ine:75.2", "ine:75.2", "ine:11615.", "ine:10603", "ine:334.2", "ine:7256.8", "ine:7256.8", "ine:996.8", "ine:884.6", "ine:364.9", "ine:6360", "ine:5640.9", "ine:2729.7", "ine:5482.6", "ine:85", "ine:1474.9", "ine:700.8", "ine:2754.6", "ine:3257.4", "ine:3257.4", "ine:7307.8", "ine:18560.", "ine:85.1", "ine:364.8", ":700.1", ":5317", "l:4258.9", "l:4258.9", "l:1637.6", "l:1637.6", "l:46.4", "l:3938.5", "l:3938.5", "l:2800.4", "l:2715.1", "l:2715.1", "l:12708.2", "l:1042", ":499.3", "nk Transfe", "de of tran", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "up(non-US ", "ine:4121", "ine:3257.4", "ine:75.2", "ine:75.2", "ine:11615.", "ine:10603", "ine:334.2", "ine:7256.8", "ine:7256.8", "ine:996.8", "ine:884.6", "ine:364.9", "ine:6360", "ine:5640.9", "ine:2729.7", "ine:5482.6", "ine:85", "ine:1474.9", "ine:700.8", "ine:2754.6", "ine:3257.4", "ine:3257.4", "ine:7307.8", "ine:18560.", "ine:85.1", "ine:364.8", ":700.1", ":5317", "l:4258.9", "l:4258.9", "l:1637.6", "l:1637.6", "l:46.4", "l:3938.5", "l:3938.5", "l:2800.4", "l:2715.1", "l:2715.1", "l:12708.2", "l:1042", "25", "1", "1", "26", "27", "28", "29", "30", "31", "25", "32", "33", "4", "4", "3", "3", "5", "5", "7", "6", "6", "27", "28", "30", "25", "32", "33", "9", "8", "1", "1", "10", "12", "12", "16", "16", "16", "16", "8", "1", "3", "3", "7", "7", "25", "9", "9", "1", "10", "10", "14", "14"), .Dim = c(104L, 2L), .Dimnames = list(NULL, c("newsendId", "newtoId")))

The generated figure is as follows. I used the following command to generate it

Gw <- qgraph(edgeList, layout = "spring", diag = FALSE, labels = TRUE, cut = NULL, edge.color = "red",legend.cex = 0.5, vsize = 8)


回答1:


Which nodes are problems? With your data and code you can modify label.cex. There are other variations of the arguments for the label and legend sizes

. Here is one version, with the color blue.
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


来源:https://stackoverflow.com/questions/29451894/invalid-color-name-background-in-qgraph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!