replace plyr by dplyr 3