r - UpsetR:添加数字标签以设置绘图大小

标签 r upsetr

是否有任何方法可以在 UpsetR 中的设置大小栏顶部添加标签,类似于主交集图的 show.numbers ?

test <- upset(grouped_hot,
              sets                = c("A", "B", "C", "N"),
              nintersects         = 8,
              mb.ratio            = c(0.6, 0.4),
              sets.x.label        = "Number of Patients",
              sets.bar.color      =  "#56B4E9",
              mainbar.y.label     = "Number of Patients",
              order.by            = "freq",
              empty.intersections = "on",
              keep.order          = FALSE,
              scale.sets          = "identity",
              att.pos             = "top",
              text.scale          = c(2.5, 2.5, 2, 1.5, 2.5, 2.5))

预期结果是在每个设置的尺寸条上都有标签,说明尺寸。

最佳答案

可以使用 set_size.show 来做到这一点:

test <- upset(grouped_hot, sets= c("A", "B", "C", "N"), 
        nintersects = 8, 
        mb.ratio = c(0.6, 0.4), 
        ...
        att.pos = "top", 
        text.scale = c(2.5,2.5,2,1.5,2.5,2.5),
        set_size.show = TRUE)

但是,Cran 上当前的软件包版本不支持此参数,因此您应该在开发模式下工作(使用 devtools)。该过程写得很好:https://github.com/hms-dbmi/UpSetR/pull/104#issuecomment-376245215

确保在处于开发模式时加载包。如果您之前加载它,它会从保存在存储库中的 cran 加载版本。

最好,安娜

关于r - UpsetR:添加数字标签以设置绘图大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55788414/

相关文章:

r - 如何使用 ascii、html 或 markdown 格式在 R 中打印表格?

r - 附录当前给我一个只有标题的空白页 - R Markdown

r - 2 条曲线之间的阴影区域

r - 通过R中的特定行名将行数据转换为列

R:为图中的轴区域添加大括号

r - 复杂不安 : How can I plot ONLY specific intersections?

r - UpSetR sets.bar 交互不同颜色及其集合交集

r - 如何从向量 R 中的共同元素创建向量