Created
June 13, 2019 07:25
-
-
Save SachaEpskamp/c14b288903a2f699e821ad175dcc2577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("qgraph") | |
library("bootnet") | |
# Number of nodes: | |
nNode <- 10 | |
# Make a list with intervals: | |
intervals <- replicate(nNode,sort(runif(2,0.5,1)),simplify = FALSE) | |
# Rescale intervals so they represent difference: | |
pieList <- lapply(intervals,function(x)diff(c(0,x))) | |
# Colors: | |
col <- c(0.95,0.2) | |
pieColors <- replicate(nNode, rgb(col,col,col), simplify = FALSE) | |
# Some network: | |
net <- genGGM(nNode, p = 0.4, nei = 2) | |
# Plot: | |
layout(1) | |
qgraph(net, pie = pieList, pieColor = pieColors, layout = "spring", | |
vsize = 15, pieBorder = 0.25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment