我正在尝试根据博客文章更多网络布局在 R 中实现可折叠网络。但是,我总是收到Object not found
.
devtools::install_github
devtools::install_github("timelyportfolio/networkD3@feature/d3.chart.layout")
library(htmltools)
library(networkD3)
hc = hclust(dist(mtcars))
treeNetwork(
as.treeNetwork(hc, "mtcars")
)
tagList(
lapply(
c("tree.cartesian"
,"tree.radial"
,"cluster.cartesian"
,"cluster.radial"
)
,function(chartType){
hierNetwork(as.treeNetwork(hc), type=chartType, zoomable=T, collapsible=T)
}
)
)
tree.cartesian
编辑 1
我们如何将这些图用于边缘文件来构建网络?例子:
From To
A B
A C
A D
D L
L J
J T
B O