Data Management, Manipulation, and Exploration with dplyr
Andrew P. Beckerman, Dylan Z. Childs, Owen L. Petchey · Oxford University Press eBooks · 2017
Once your data are in R, you may need to manipulate them. We show you how to refer to columns/variables of your data, how to extract particular subsets of rows, how to make new variables, and how to sort your data. All these are done with functions from the dplyr add-on package, such as select, slice, filter, mutate, transform, arrange, and sort. You then learn how to calculate summary statistics of groups of your data, including the mean and standard deviation. We demonstrate two ways of giving dplyr instructions too, introducing ‘piped’ vs ‘nested’ instructions. Finally, we provide a comparison of between classic ‘base R’ methods and the modern dplyr methods, which is vital for collaboration.