How to connect variables over columns for analysis

Hi,

I think I know what you are trying to do, but it's very difficult to be sure or give specific code without some data and an example of the output.

In order for us to help you with your question, please provide us a minimal reproducible example where you provide a minimal (dummy) dataset and code that can recreate the issue. Once we have that, we can go from there. For help on creating a Reprex, see this guide:

Good luck!
PJ