dplyr with subgroup join
问题 The following problem can be seen as a "two-column reshape to wide", and there are several methods available to solve it the classical way, from base::reshape (horror) to reshape2 . For the two-group case, a simple subgroup join works best. Can I reformulate the join within the piping framework of dplyr ? The example below is a bit silly, but I needed the join in a longer pipe-chain which I do not want to break. library(dplyr) d = data.frame(subject= rep(1:5,each=2),treatment=letters[1:2],bp