networkD3: radialNetwork (diagonalNetwork)
https://loankimrobinson.com/wp-content/uploads/2019/08/network3D_diagonalNetwork.csv
<pre class="wp-block-syntaxhighlighter-code">[code lang="r"]
library(networkD3)
library(data.tree)
df <- read.csv("network3D.csv",stringsAsFactors = FALSE)
# using data.tree to create a tree
networkD3 <- data.tree::FromDataFrameNetwork(df)
networkD3 <- as.list(networkD3, mode = 'explicit', unname = TRUE)
# Create color for node, link and text
nodeVector <- c("black", rep("red", 2), rep("blue", 5),rep("green", 19))
linkVector <- c(rep("red", 2), rep("blue", 5),rep("#66bd63", 19))
textVector <- c("#e08214", rep("#01665e", 2), rep("#9e0142", 5),rep("#2166ac", 19))
# apply js
network_vector <- lapply(list(nodeVector,linkVector,textVector), function(j) {
JS(paste0('function(d, i) { return ',paste0('["', paste(j, collapse = '", "'), '"]'), '[i]; }'))
})
# save html file
library(magrittr)
diagonalNetwork(List = networkD3,
fontSize = 20,
opacity = 0.9,
margin = NULL,
height = 400, width=600,
nodeStroke = network_vector[[1]],
linkColour = network_vector[[2]],
textColour = network_vector[[3]]) %>% saveNetwork(file = 'network3D.html')
[/code]</pre>
1+
5 Comments
sikis izle
I do accept as true with all the ideas you have introduced to your post. Tiffany Rolph Urata
porno
My family members every time say that I am killing my time here at web, except I know I am getting knowledge daily by reading such good posts. Tess Carlo Chesna
sikis izle
Hi there Dear, are you in fact visiting this site on a regular basis, if so after that you will without doubt obtain good experience. Hattie Allie Sessler
erotik izle
I saw a lot of website but I conceive this one has got something special in it. Zora Reuven Purpura
erotik izle
I am truly pleased to glance at this webpage posts which contains lots of useful facts, thanks for providing these kinds of data. Connie Jamil Merl