Question: Problem with UpSetR result
0
gravatar for Raheleh
5 days ago by
Raheleh120
Raheleh120 wrote:

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!

upset upsetr intersections • 60 views
ADD COMMENTlink modified 5 days ago by russhh4.8k • written 5 days ago by Raheleh120
0
gravatar for russhh
5 days ago by
russhh4.8k
UK, U. Glasgow
russhh4.8k wrote:

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 COMMENTlink written 5 days ago by russhh4.8k

Thanks, but I got this error:

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

ADD REPLYlink modified 5 days ago • written 5 days ago by Raheleh120
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1082 users visited in the last hour