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2 2 2 2 2 2 2 2 4 4 1
[69] 2 4 2 5 1 2 2 3 2 2 3 2 2 2 1 1 0 4 4 1 2 2 1 0 0 2 1 2 3 2 2
$E
[1] 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1
[53] 1 1 0 0 0 0 0 2 1 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 2 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0
$F
[1] 5 0 2 0 2 0 0 0 0 2 2 2 1 0 1 2 1 2 3 1 2 2 8 2 1 0 1 1 0 0 1 1 1 6
[35] 0 2 0 1 2 2 0 0 0 0 2 2 1 2 16 2 1 2 1 2 0 1 1 2 1 2 1 2 2 1 2 1 1 0
[69] 1 1 1 0 4 1 2 2 0 2 1 1 1 1 1 2 0 0 0 0 2 0 0 2 3 0 1 0 0 1 1
and used as below:
> upset(mydata)
Error in 1:ncol(data) : argument of length 0
for another usage:
>upset(fromList(mydata), sets = c("A", "B"))
which shows the intersection size between A and B is 3, which is not true when I check the data.
nsetslimits the number of interactions shown to 7. If you want more than you have to increase that number.Thank you for reply, but it did not change.
I selected F and G columns only to test using two different functions below:
in the first code I used
upsetfunction only and in the second code I usedfromListfunction as well. But results are different. I attached two figures (fromList and upset titles).upset and fromlist functions
Is
mydataa list or a data frame? It should be a list. Based on the output, it looks like a data frame.What does
str(mydata)look like?