r circlize 报告 gap.degree 太大
r circlize report gap.degree is too large
我正在尝试使用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" ...
这是因为你的矩阵行数太多。在您的情况下,如果行和列引用不同的元素,则图中将有 421 + 7 = 428 个扇区。默认情况下,每两个相邻扇区之间有一个宽度为 1 度的间隙。因此,在您的情况下,间隙总和为 428 度,大于整个圆(360 度),因此没有 space 用于绘图扇区。
我正在尝试使用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" ...
这是因为你的矩阵行数太多。在您的情况下,如果行和列引用不同的元素,则图中将有 421 + 7 = 428 个扇区。默认情况下,每两个相邻扇区之间有一个宽度为 1 度的间隙。因此,在您的情况下,间隙总和为 428 度,大于整个圆(360 度),因此没有 space 用于绘图扇区。