i am trying to concatenate all values with unique column value by pivoting the data frame
var = c("X","X","Y","Z","Z","Z")
value =c(1,4,7,21,3,45)
df = data.frame(var,value)
o/p
df1
var value
X (1),(4)
Y (7)
Z (21),(3),(45)
Thanks in advance