I there, I´d like to mutate new column appending the data (strings) from other variable which have in common the same code.
Input:
a<- data.frame(id= c(1,1,1,2,2,3,3,3,3), description = c("roberto", "alberto", "laura", "rafael", "luisa",
"alex", "sergio", "mateo", "jose"))
Output:
a1<- data.frame(id= c(1,1,1,2,2,3,3,3,3), description = c("roberto", "alberto", "laura", "rafael", "luisa",
"alex", "sergio", "mateo", "jose"),
new = c( "roberto alberto laura","roberto alberto laura","roberto alberto laura",
"rafael luisa","rafael luisa",
"alex sergio mateo jose","alex sergio mateo jose","alex sergio mateo jose","alex sergio mateo jose" )
)
Do you know some way to make it possible?
Many thanks