I have the following data structure
ID Type Values 1 A 5; 7; 8 2 A 6 3 B 2; 3
and I would like to reshape it to the fol
Since you asked for a plyr solution, here you go:
plyr
ddply(df, .(Type), function(foo) { values <- unlist(strsplit(c(foo$Values), ";")) data.frame(Type = rep(unique(foo$Type), length(values)), Values = values) })