Question: Problem with UpSetR result
0
gravatar for Raheleh
4 months ago by
Raheleh140
Raheleh140 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 • 116 views
ADD COMMENTlink modified 4 months ago by russhh5.2k • written 4 months ago by Raheleh140
0
gravatar for russhh
4 months ago by
russhh5.2k
UK, U. Glasgow
russhh5.2k 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 4 months ago by russhh5.2k

Thanks, but I got this error:

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

ADD REPLYlink modified 4 months ago • written 4 months ago by Raheleh140
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: 1687 users visited in the last hour