1

如果我运行这个 reprex,我会得到所需的输出:

``` r
library(UpSetR)
listInput <- list(one = c(1, 2, 3, 5, 7, 8, 11, 12, 13), 
                  two = c(1, 2, 4, 5, 10), 
                  three = c(1, 5, 6, 7, 8, 9, 10, 12, 13))

upset(fromList(listInput), order.by = "freq")
```

如果我应用颜色,我会收到以下错误。

``` r
library(UpSetR)
listInput <- list(one = c(1, 2, 3, 5, 7, 8, 11, 12, 13), 
                  two = c(1, 2, 4, 5, 10), 
                  three = c(1, 5, 6, 7, 8, 9, 10, 12, 13))

upset(fromList(listInput), order.by = "freq",
      queries = list(list(query = intersects, params = list("one"), color = "orange", active = T)))
#> Error in eval(expr, envir, enclos): object 'freq' not found
```

我查看了插图中的着色“示例 5”,但无法发现我的失误。

4

1 回答 1

3

将一列整数添加到输入到的数据框中upset

library(UpSetR)
listInput <- list(one = c(1, 2, 3, 5, 7, 8, 11, 12, 13), 
                  two = c(1, 2, 4, 5, 10), 
                  three = c(1, 5, 6, 7, 8, 9, 10, 12, 13))
df <- fromList(listInput)
df$n <- sample(1:nrow(df))

upset(df, order.by = "freq",
      queries = list(list(query = intersects, 
                          params = list("one"), 
                          color = "orange")))

在此处输入图像描述

于 2017-11-17T16:10:56.077 回答