I have this data.frame
:
c_dupli <- data.frame(id=c(1,1,2), value=c(10,20,30))
My intention is to leave the id
unique, but keep the value
different in another / s column / s. The expected result is the following:
s_dupli <- data.frame(id=c(1,2), value1=c(10,30), value2=c(20,"NA"))
Any suggestions? Thanks.