I have a large set of financial statements imported into R and need to summarize the account names (VarN in the example below) by the column Years (YN) below and by amount (vN) below. I have searched for solutions using reshape and dplyr, but to no avail. I have:
Var1 Y1 v1
Var2 Y1 v2
Var3 Y1 v3
Var1 Y2 v4
Var2 Y2 v5
Var3 Y2 v6
I need to convert to:
Y1 Y2
Var1 v1 v4
Var2 v2 v5
Var3 v3 v6