I'd recommend the `pivot_longer` approach from the duplicate. If you need more help than that, please show the code you tried and provide sample data in a format that we can demonstrate a solution on - copy/pasteable text, not a picture.
– Gregor ThomasNov 15 '22 at 18:20