Problem using `list_to_matrix` function for UpsetR package

Hi, community!
I am using the UpsetR package for finding intersections among the sets with the size of the intersection. For that I am using this tutorial. It instructs to make a list of vectors (where each vector is a set) and then convert the list to a matrix. It uses the following code:

lt = list(set1 = c("a", "b", "c"),
          set2 = c("b", "c", "d", "e"))

But, when I use the same in my console, I find the following error:

> list_to_matrix(lt)
Error in list_to_matrix(lt) : 
'list_to_matrix()' requires a list of numeric vectors

Can anyone please tell me how can I get rid of the error and proceed smoothly?

Thanks and regards,

Your vectors, set1 and set2 are not numeric (they are character vectors). I see that the same code is used in the tutorial to which you linked, but I'm not sure what package that function, list_to_matrix(), is coming from. So, I can't check to see if something in the source code has changed.

Could you please turn this into a self-contained reprex (short for reproducible example)?

There's a nice FAQ on how to do a minimal reprex for beginners, below:

For pointers specific to the community site, check out the reprex FAQ.

1 Like

Thanks @mara the list_to_matrix() is coming from turner package.

Could you run a reprex please (see instructions in post above)?

1 Like

Thanks @mara for your reply. I don't understand reprex of which part do you actually want. I just mentioned the whole code that I have used. Can you please clarify?


Shouldn't it be from ComplexHeatmap ?


Thanks @nirgrahamuk . I don't know why I am getting the function from both ComplexHeatmap and turner package. And, thanks to you as it is working fine when I loaded it from ComplexHeatmap package.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.