Each unique year, site, quadrant, and species has two values "Val" in the dataset. I want to spread the values into two columns "Val1" and "Val2". I tried to use the regular spread function but it doesn't seem like its the right fit. Any suggestions?
Year Site Quadrant Species Val
2019 1 1 A 20
2019 1 1 A 30
2019 1 1 B 20
2019 1 1 B 25
2019 1 2 A 20
2019 1 2 A 10
2019 1 2 B 11
2019 1 2 B 22
Desired Output
Year Site Quadrant Species Val1 Val2
2019 1 1 A 20 30
2019 1 1 B 20 25
2019 1 2 A 20 10
2019 1 2 B 11 22