I would like to transform following data table
da<-data.table(Gr=c("A","B","B","B","A","B"),
mmoSze=c("SCRSCR","SCRSCR","OSNOSN","Eig.SCRSCR","Eig.SCRSCR","Eig.OSNOSN"),
SCR=c(25, 43, 61, 79, 97, 115))
into:
da.goal<-data.table(GR=c( "A", "B"),
SCRSCR=c( 25, 43),
OSNOSN=c( 0, 61),
Eig.SCRSCR=c( 97, 79),
Eig.OSNOSN=c( 0, 115))
using data.table
!
One possible undesirable way would be to divide the table and then merge them. What is the elegant way to do it?