Skip to content

Instantly share code, notes, and snippets.

@SachaEpskamp
Created June 19, 2019 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SachaEpskamp/442f9ca7c1ed2286d13b3a5a820e8f5c to your computer and use it in GitHub Desktop.
Save SachaEpskamp/442f9ca7c1ed2286d13b3a5a820e8f5c to your computer and use it in GitHub Desktop.
# Load network:
library("maps")
library("qgraph")
map("world", fill=TRUE, col="white", bg="lightblue", ylim=c(-60, 90), mar=c(0,0,0,0))
# Some network with 4 nodes:
Adj <- matrix(1,4,4)
# Layout using coordinates:
Layout <- matrix(c(
4.9036, 52.3680,, # Amsterdam
103.8198, 1.3521, , # Singapore
-74.0060, 40.7128, , # New york
-58.3816, -34.6037, # Buenos Aires
),,2,byrow=TRUE)
# Plot network:
map("world", fill=TRUE, col="white", bg="lightblue", ylim=c(-60, 90), mar=c(0,0,0,0))
qgraph(Adj, labels = FALSE, layout= Layout[,2:1], color = "black", edge.color = "black",
plot = FALSE, rescale = FALSE, usePCH = TRUE, vsize = 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment