# NOT RUN {
if(require(gRbase) & require(graph)){
graph <- gRbase::ug(~a:b, ~a:c, ~c:d, ~b:d, ~b:c)
# Plot a graphNEL
plotGraphNELD3(graph)
# Plot a graphNEL coloring edges in correspondance with pairwise correlation coefficients
S <- matrix(c(2, 0.8,0.5,-0.3,
0.8,1.5,0.6,-0.7,
0.5,0.6,1, 0.7,
-0.3,-0.7,0.7,3), ncol=4,nrow=4)
colnames(S) <- rownames(S) <- graph::nodes(graph)
plotGraphNELD3(graph, S1=S)
# Plot a graphNEL coloring edges in correspondance with partial correlation coefficients
plotGraphNELD3(graph, S1=S, type="pcor")
# Change the color range
plotGraphNELD3(graph, S1=S, type="cor", colLim=c(-0.7,0.8))
# Change nodes color
plotGraphNELD3(graph, S1=S, type="cor", colNode = "pink")
# Plot the difference between two graphical models
S2 <- S
S2[1,3] <- S2[3,1]<- -0.1
plotGraphNELD3(graph,S1=S, S2=S2)
}
# }
Run the code above in your browser using DataLab