簡體   English   中英

為什么在circlize初始化時會出現這個xlim錯誤?

[英]Why does this xlim error occur in circlize initialization?

我想用 circlize 初始化一個新的和弦圖,但是我收到了一個錯誤,考慮到我輸入的數據似乎沒有任何意義:

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.

我理解這個要求,但是當我嘗試制作不同的地塊時,它對一些人來說失敗了,但對另一些人來說卻沒有。 這是相關的代碼片段,其中包含一些用於調試的 output

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)

工作正常的 plot 的 output :

[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.

我知道這些問題: 這個問題讓我檢查了 class

這讓我檢查了我的 circlize 版本(0.4.11)

我錯過了什么??? 感謝您的任何幫助,您可以提供。

經過大量的拉扯,我發現了問題:我的區域變量(circos.initialize中的因子或扇區條目)中有重復值,因此扇區的有效數量低於變量的維度。 希望沒有其他人愚蠢到會犯這個錯誤,但以防萬一,現在他們可以有一個額外的東西來檢查他們是否遇到這個錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM