1

I have the following code:

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))

which produces this plot:

enter image description here

As you can see currently the barplot on the left is ordered according to size. I'd like to order it from top to bottom as: three, two, one.

How can I achieve that?

littleworth
  • 4,781
  • 6
  • 42
  • 76

1 Answers1

3

You can manually order the sets by inputting them manually to set and setting keep.order=TRUE

upset(fromList(listInput[c(1,2,3)]), 
      keep.order = T, 
      sets = c("one", "two", "three"))

enter image description here

GordonShumway
  • 1,980
  • 13
  • 19
  • but what if we want to order the points in the plots too in this plot we see the black dot of "three" then "one" then "two". How can we see "three", "two" and "one" ?! – learners Aug 11 '23 at 10:04