I have ecommerce data with about 6000 SKUs and 250,000 obs. Simple version below but a lot more sparse. There is only one SKU per line as each line is a transaction. What I have: I want to create a weighted undirected adjacency matrix so that I can do some graph analysis on the market baskets. It would look like