# NOT RUN {
## Create an interactive network graph in a temporal directory of your local machine
## Live examples on https://rjsplot.usal.es
if(interactive()){
# Prepare data
x <- 1-cor(t(mtcars))
source <- rep(rownames(x),nrow(x))
target <- rep(rownames(x),rep(ncol(x),nrow(x)))
links <- data.frame(source=source,target=target,value=as.vector(x))
# Generate the network graph
network_rjs(links[links[,3]>0.1,], mtcars, group = "cyl", size = "hp", color = "mpg")
}
# }
Run the code above in your browser using DataLab