No Commission

No Commission is a concept originated by super producer, art collector, and Harvard Business School graduate Kaseem “Swizz Beatz” Dean. He and wife, Alicia Keys, are the owners of an expansive art…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to create a chord diagram and add legends in R

First thing first, I’ve included the packages for plotting the diagram. In order to install ComplexHeatmap, you would have to install BioManager first, and use install functions in BioManager to install ComplexHeatmap (might have been updated now). I commented the installation codes just in case you need it. I believe the other packages can either be installed through CRAN or github. The last package chorddiag is irrelevant to this tutorial, but it’s another neat package for chorm diagram. I believe it’s a wrapper for D3, which is more interactive than circlize.

Let’s go ahead and create some dataset!

This is what the sample data looks similar to this:

Now that we have the chord diagram, let’s get the legend on the side.

Viola! Now we have a chord diagram with legends on the sides, and you can adjust the positions of different legends based on your screen size. It’s a bit of manual work, but the results are satisfying.

Add a comment

Related posts:

How Does It Feel?

Twenty years after Voodoo, revisiting my first encounter(s) with D’Angelo’s “Untitled”: part seance, part sexual awakening. Poor John . . . Alone, exiled to the isle of Patmos, must have had some…

Global Tungsten Rods Market Overview

According to the Regional Research Reports, the Global Tungsten Rods Market size was valued at a million USD in 2021 and will reach multi-million USD by 2030, at a CAGR of 5.20% from 2022 to 2030…

What are personal injury cases?

Personal Injury cases are lawsuits that are filed by someone who has been injured by the negligence of another party. It can be either a person or a company. For instance, if you had an accident and…