Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Problems with the function "insert_left"

未關閉
#35 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
r

研究方向

Start by reproducing the supplied heatmap and dendrogram example with aplot 0.2.0, then compare the same call with 0.1.8 and 0.1.9. Trace the insert_left entry point and the limit handling that produces the zero_range error; done means the example combines successfully without the coercion warning or missing-value error.

由索引模型根據 Issue 內容生成。

描述

When using the aplot package (version 0.2.0), the following error message appears when using the function "insert_left":

Error in if (zero_range(as.numeric(limits))) { : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In zero_range(as.numeric(limits)) : NAs introduced by coercion

We have a matrix to plot heatmap like this:

image

And then we use the following code to generate the cluster tree:

  dd <- dist(plotdata1, method = "euclidean")
  hc <- hclust(dd, method = "ward.D2")
  
  library(ggdendro)
  pa=ggdendrogram(hc,theme_dendro = F)+
    coord_flip()+
    scale_y_reverse()+
    theme_void()
image

Then the heatmap plot was plotted using the following code:

plotdata1 %>% ggplot(aes(x=condition,y=celltype))+
    geom_tile(aes(fill = value),color = tile_color)+
    scale_y_discrete(expand = c(0,0),position = "right")+
    scale_x_discrete(expand = c(0,0))+
    theme_bw()+
    theme(
      panel.grid = element_blank(),
      axis.title = element_blank(),
      axis.ticks.length = unit(0.15,"cm"),
      axis.text.y.right = element_text(size = 12,colour = "black"),
      axis.text.x.bottom = element_text(size = 12,colour = "black",angle = 0,hjust = 0.5)
    )
image

And if I want to combine the two plot, Error was occured:

>insert_left(pb,pa,width = relative_width)
Error in if (zero_range(as.numeric(limits))) { : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In zero_range(as.numeric(limits)) : NAs introduced by coercion

However, aplot (version 0.1.8) works fine whereas vesion 0.1.9 and 0.2.0 can't. So maybe it's necessary to solve this problem in the next vesion.

主要語言
R
星號
131
分支
17
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

YuLab-SMU/aplot 的其他 Issue

查看 YuLab-SMU/aplot 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。