**60**wrote:

Do you know if there is a way to extract the interaction matrix UpSetR is creating for its plots?

I want to plot the interactions in between the columns of my data.frame, but I have several columns and UpSetR style of plotting is quite heavy. To solve this problem, I'd like to extract the values and interactions UpSetR is calculating for its matrix and use it to build a heatmap which I think will be more easy to read.

Do you have any suggestion on how to export the upsetR data?

Example of UpSetR: https://cloud.githubusercontent.com/assets/12614369/8468576/18d5ef52-203c-11e5-9f5d-e034ec41c538.png

What I have in mind (source: Intervene R package): https://intervene.readthedocs.io/en/latest/_images/pairwise_tribar.png

My dataframe structure is like:

```
dummy_df <- data.frame(A = c(1,1,1,0),
B = c(0,1,0,1),
C = c(0,1,0,1),
D = c(1,0,0,0),
E = c(0,0,0,0))
```

But I have a 2000x24 dataframe.

If it's not possible to extract this info from UpsetR: Ultimately, I'd like to have a list of interaction which is reporting how many times that columns have "1s" together in the same row. e.g.:

```
ABC = 1,
AD = 1,
BC = 1,
A = 1,
```

And a matrix reporting the rows which are sharing "1s" in columns (it can be the count, but better a fraction)

```
A B C D E
A 1
B 0.25 1
C 0.25 0.5 1
D 0 0 0 1
E 0 0 0 0 1
```

Any help would be much appreciated.

**29k**• written 6 months ago by ste.lu •

**60**