Using R to organize/rearrange CSV - group by multiple columns?
This very simple using the pivot_wider function from tidyr:
library(tidyr)

df &lt;- data.frame(
  Prop_ID = c(1, 1, 1, 2, 2, 2),
  deforYear = c(2010, 2011, 2012, 2010, 2011, 2012),
  deforHA = c(15, 0, 10, 35, 45, 0)
)

df %&gt;% 
    pivot_wider(names_from=deforYear, values_from=deforHA, names_prefix=&quot;deforYear_&quot;)

# result
  Prop_ID deforYear_2010 deforYear_2011 deforYear_2012
1       1             15              0             10
2       2             35             45              0