I want to convert table dt:
Who T Res
Pam 2 B
Pam 3 E
Pam 5 F
Bob 2 B
Bob 5 C
into
Who T1 Res1 T2 Res2 T3 Res3
Pam 2 B 3 E 5 F
Bob 2 B 5 C NA NA
using dcast or other function/s from data.table.
I have tried things such as dcast(dt, Who ~ T + Res)
but got just undesired outputs.