Dear all, I have the following R dataframe: set.seed(11) (df <- data.frame(ID=rep(1:10,1:10),a=factor(sample(1:4,55,rep=T)) )) where ID is an identification code. I need to create a new variable "b" in which I would paste the full group of "a" variable according to ID variable. For example for ID=2 "b" should be 13, for ID=3 "b" should be 114, and for ID=4 should be 1241. How can I do that ? Thank you for any advices, Regards, Massimiliano Tripoli
[[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.