I am working on a school project regarding forest types and some measurements. I have the Site_ID & measurement as two columns, but within Site_ID there are only 3 options. We'll call them 1, 2, 3. I just need to make three new columns, with their measurements sorted by Site_1, Site_2, Site_3. The end goal for all of this is to perform an aov().
I'm still not sure of the formatting on this site so forgive me for this, but lets say I have a table like this:
Site_ID ------ Measurement
1 ------- 34
1 --------3434
1--------34324
2 ------ 34324
2 ------ 6768
2-----4534
3 ------ 657467
3 ----- 4346
3------ 345234
I just need it to be sorted by Site_ID:
Site_1 ------- Site_2 ------ Site_3
34 ---------- 34324 ----------657467
3434 --------- 6768 -------- 4346
34324 --------- 4534 ----- 345234
All of this sounds super doable to me, as in I remember doing it in my R class, but I've scrubbed through my notes and cannot figure it out. I could've sworn it had to do with pivot_longer() or left_join() or something like that, but it's not seeming to work. Thanks!