Problem with UpSetR result
1
0
Entering edit mode
5.1 years ago
Raheleh ▴ 260

Hello, I have a dataframe with 3 variable and 56 observations which are just 1 and 0. Instead of venn diagram I am useing UpsetR package to find the intersections between variables. This is the link. This is my script:

dat <- read.delim("dat.csv", sep = ",", stringsAsFactors = FALSE)
upset(dat, nsets = 3, nintersects = 7, mb.ratio = c(0.5, 0.5))

This is my data:

LNMD    EMVI    EMPNI
0   0   0
0   0   0
0   0   0
0   0   0
0   0   0
0   1   0
0   1   0
0   1   0
0   1   0
0   1   0
0   1   0
0   1   0
1   0   0
1   0   0
1   0   0
1   0   0
1   0   0
1   0   0
1   0   0
1   0   1
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   0
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1
1   1   1

Although I got result, it is not correct. For example I sat the nintersects as 7 but it returned just 5!!! This is the image:

enter image description here

I really appreciate any help!

UpSetR Intersections upset • 1.5k views
ADD COMMENT
0
Entering edit mode
5.1 years ago
russhh 5.7k

I can only see 6 non-empty intersections in your data, one of which is for those things that aren't a member of any of your three sets. You could add an additional column to indicate these separately

dat %>%
    dplyr::mutate(Other = 1 * (rowSums(dat) == 0)) %>%
    upset(.....)
ADD COMMENT
0
Entering edit mode

Thanks, but I got this error:

Error in [.default(data, sets) : invalid subscript type 'list'

ADD REPLY

Login before adding your answer.

Traffic: 2138 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6