replace dplyr with reshape2's melt