Ai
1 Star 0 Fork 3

weijiew/R-graph-gallery

forked from 程序员维C社区/graph 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
123-circular-plot-circlize-package-2.Rmd 3.32 KB
一键复制 编辑 原始数据 按行查看 历史
holtzy 提交于 2019-06-11 05:54 +08:00 . circular almost OK
title descriptionMeta descriptionTop sectionText sectionLink DataToVizText DataToVizLink url output
Advanced chord diagram with R and circlize
Chord diagram is an efficient way to display flows between entities. This post shows how to build it from an edge list or from an adjacency matrix, using the circlize package.
[Chord diagram](chord-diagram.html) is an efficient way to display flows between entities. This post shows how to build it from an edge list or from an adjacency matrix, using the `circlize` package.
Chord section
chord-diagram.html
Data to Viz
data-to-viz.com/graph/chord.html
123-circular-plot-circlize-package-2
html_document
self_contained mathjax lib_dir template css toc toc_float toc_depth df_print
false
default
libs
template_rgg.html
style.css
true
true
2
paged
```{r global options, include = FALSE} knitr::opts_chunk$set( warning=FALSE, message=FALSE) ```
# Chord diagram from adjacency matrix ***
The `chordDiagram()` function of the `circlize` package makes it a breeze to build chord diagrams from adjacency matrix in R. The adjacency matrix displays all origins in rows, and all destinations in columns. Each cell is filled with a numeric value specifying the flow strength. Note: visit the [chord section](chord-diagram.html) of the gallery or the circlize [vignette](https://cran.r-project.org/web/packages/circlize/vignettes/circlize.pdf) for more chord examples.
```{r thecode, echo=FALSE, out.width = "100%", fig.height=7} # Create an adjacency matrix: # a list of connections between 20 origin nodes, and 5 destination nodes: numbers
```{r thecode, eval=FALSE} ``` # Chord diagram from edge list ***
Another common format to store flow information iis the edge list. Basically, all connections are stored one by one in a 2 columns file, listing the origin and destination of each. Since the `chordDiagram()` function expects an adjacency matrix as input, it is required to use the `table()` function for reformating, as described below:
```{r thecode2, echo=FALSE, out.width = "100%", fig.height=7} # Create an edge list: a list of connections between 10 origin nodes, and 10 destination nodes: origin
```{r thecode2, eval=FALSE} ```
```{r, echo=FALSE} htmltools::includeHTML("htmlChunkRelatedFlow.html") ```
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/weijiew/R-graph-gallery.git
git@gitee.com:weijiew/R-graph-gallery.git
weijiew
R-graph-gallery
R-graph-gallery
master

搜索帮助