Many of the uses I've seen use an aggregation function, such as average.
How about whether you just want to change the form without losing information. For example, if I want to take this long format:
ID condition Value John a 2 John a 3 John b 4 John b 5 John a 6 John a 2 John b 1 John b 4
In this wide format without any aggregation:
ID ab John 2 4 John 3 5 Alex 6 1 Alex 2 4
I assume that this assumes that the observations are paired and you have lost the value, it will ruin, but any understanding will be appreciated
source share