You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi jmbh,
The correct way to specify colors for different groups is by using a vector
(group_cols) with one color by group instead of one color by node.
Otherwise the first 3 colors of group_cols in your example ("green" "green"
"blue" ) are interpreted as the colors of the three groups.
Here is a revised example that should work:
set.seed(1)
p <- 10
g <- matrix(sample(0:1, p^2, replace=T),p,p)
g <- pmax(g,t(g)); diag(g) <- 0
groups <- sample(c("group1", "group2", "group3"), p, replace=T)
reproducible example:
set.seed(1)
p <- 10
g <- matrix(sample(0:1, p^2, replace=T),p,p)
g <- pmax(g,t(g)); diag(g) <- 0
groups <- sample(c("group1", "group2", "group3"), p, replace=T)
group_cols <- numeric(p)
group_cols[groups=="group1"] <- "blue"
group_cols[groups=="group2"] <- "green"
group_cols[groups=="group3"] <- "red"
qgraph(g, colors=group_cols, groups=groups)
The text was updated successfully, but these errors were encountered: