我正在尝试用R.circlize包中的chordDiagram函数绘制和弦,参考代码类似于“matrix visualization”
set.seed(999)
chordDiagram(mat)
circos.clear()
错误报告如:
circos.initialize(factors = factors, xlim = xlim) :
Maybe your `gap.degree` is too large so that there is no space to allocate sectors.
和我的'mat'看起来像:
> str(mat)
num [1:421, 1:7] 2 0 2 0 0 0 0 0 0 0 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:421] "BCM,SCM_2,Accept_Dismiss" "BCM,TCU_2,ActualGear" "BCM,ACM_1,AirbagPassengerLED" "BCM,ACM_1,AirbagWarningLamp" ...
..$ : chr [1:7] "MMC,RxBuffer" "IC,RxBuffer" "CCU,RxBuffer" "PEPS,RxBuffer" ...
答案 0 :(得分:1)
这是因为你的矩阵有太多行。在您的情况下,如果行和列引用不同的元素,则图中将有421 + 7 = 428个扇区。默认情况下,每两个相邻扇区之间存在间隙,宽度为1度。因此,在您的情况下,间隙的总和是428度,大于整个圆(360度),因此没有绘制扇区的空间。