0

I want to order my upset graph by percentage point instead of intersection size. I have both intersection size and percentage in my dataset. For example, I have tried:

x <- c(a=80, b=9.9, c=5, 'a&b'=0.1, 'a&c'=1.65, 'c&b'=3.35) 
upset(fromExpression(x*100), order.by = "freq",
      scale.intersections="percent", scale.sets="percent")

(Source: In UpSetR, how to show decimal number on the intersection bar)

But I got the following error:

object 'percent_trans' of mode 'function' was not found

I also tried:

upset(fromExpression(x), width_ratio=0.1, min_size=10,
  base_annotations=list(
    # with manual aes specification:
    'Intersection size'=intersection_size(text_mapping=aes(label=paste0(round(
      !!get_size_mode('exclusive_intersection')/!!get_size_mode('inclusive_union') * 100
    ), '%'))),
    # using shorthand:
    'Intersection ratio'=intersection_ratio(text_mapping=aes(label=!!upset_text_percentage()))
  )
)

Source: https://krassowski.github.io/complex-upset/articles/Examples_R.html I got error:

Error in upset_data(data, intersect, mode = mode, encode_sets = encode_sets,  : 
  argument "intersect" is missing, with no default

Can someone tell me how to solve this problem? Thanks in advance.

MicL
  • 67
  • 1
  • 8

0 Answers0