我想用circlize初始化一个新的chord图,但我得到了一个错误,考虑到我输入的数据,这个错误似乎没有任何意义:
Error: Since `xlim` is a matrix, it should have same number of rows as the length of the level of `sectors` and number of columns of 2.我理解这个要求,但是当我尝试生成不同的图时,它对一些人来说是失败的,但对另一些人来说却不是。下面是相关的代码片段,以及一些用于调试的输出
dev.new()
circos.clear()
circos.par(cell.padding=c(0,0,0,0), track.margin=c(0,0.01), gap.degree=1)
xlim = cbind(0, regionTotal)
print(class(region))
print(length(region))
print(class(xlim))
print(dim(xlim))
circos.initialize(factors=region, xlim=xlim)工作正常的绘图的输出:
[1] "character"
[1] 24
[1] "matrix" "array"
[1] 24 2对于返回错误的代码:
[1] "character"
[1] 50
[1] "matrix" "array"
[1] 50 2
Error: Since `xlim` is a matrix, it should have same number of rows as the length of the level of `sectors` and number of columns of 2.我知道这些问题:this one led me to check the class
and this one led me to check my circlize version (0.4.11)
我错过了什么?感谢您能提供的任何帮助。
发布于 2021-04-10 20:42:03
在反复尝试之后,我发现了问题:我的区域变量(circos.initialize中的因子或扇区条目)中有一个重复值,因此有效扇区数低于变量的维度。希望没有其他人会愚蠢到犯这个错误,但以防万一,如果他们遇到这个错误,现在他们可以有一个额外的东西来检查。
https://stackoverflow.com/questions/67011564
复制相似问题