I basically would like to do what is described here in r
example data
names<-c("k127_60234", "k127_60234","k127_60234","k127_60234","k127_50234","k127_50234")
values<-c("ko235", "ko123", "ko543", "ko623", "ko443", "ko123")
df <- data.frame (names,values)
and here is what I would like the output to look like - for the record the actual files will be way bigger (up tp 200k) and therefore I cannot define beforehand the number of columns
names<-c("k127_60234", "k127_50234")
values1<-c("ko235", "ko443")
values2<-c("ko123", "ko123")
values3<-c("ko543",NA)
values4<-c("ko623",NA)
df.out <- data.frame (names,values1,values2,values3,values4)