while converting Long data to wide How do I provide multiple columns to timevar argumnet in reshape
`reshape(DT, idvar="Cell", timevar = "n1", direction="wide")`
like example timevar=c("n1","n2"....)
DT<-data.table(Cell = c("A","A","B","B"), n1=c("x","y","y","a"), n2=c("t","x","x","z"))
Cell n1 n2
1: A x t
2: A y x
3: B y x
4: B a z
but I need output like below:
Cell n1 n2 n3 n4
A x y t NA
B x y a z
order of elements in n1, n2, n3 columns of output doesn't matter. only unique elements from n1 and n2 cols is required. Also I have have multiples columns like n1, n2, n3,,, n in my actual DT