I hope I'll be clear with me question. Here's a sample of my data:
date hour dist
1: 2018-06-18 Night 880.931
2: 2018-06-18 Day 8800.488
3: 2018-06-19 Night 1318.908
4: 2018-06-19 Day 2986.698
5: 2018-06-20 Night 1387.934
6: 2018-06-20 Day 3219.223
I would like to transform the datafram so it looks like this:
date Night Day
2018-06-18 880.931 8800.488
2018-06-19 1318.908 2986.698
2018-06-20 1387.934 3219.223
In other words, turning rows into columns. Is there a function for this or should this be done by hand?
Any input is appreciated!