Andrew Edwards, Pacific Biological Station.
For 'Advanced R users workshop', Pacific Biological Station, Thursday 18th February 2016.
To save the code and data (and this file) just click 'Download ZIP' in the top-right corner. If something does not work then let me know and I will update the code.
If you use GitHub then feel free to fork and commit updates!
Files are:
dummyData.RData - dummy data set, based on a set of longline survey data. Values have been generated, and so are not the original data; the data set is just for illustration of the dplyr packageR .
dplyr-introduction.r - R file to demonstrate some of the features of dplyr. Step through it one line at a time; i.e. do not just do source("dplyr-introduction.r") like you would normally with code.
README.md - this file that you are reading. It should be readable on the website, but maybe not on your laptop. Just paste it into a .txt file and view in an editor.
.gitignore - if you don't know what this is then just ignore it.
If something doesn't work or requires more explanation (likely!) then let me know and I can update the code on this site. If I had more time then I could have created simpler example code, but it was quicker to adapt what I already had.
There are tutorials on the web. One by Sean Anderson that has info about the chaining %>% command that Matt demonstrated is:
http://seananderson.ca/2014/09/13/dplyr-intro.html
I think he had an earlier version that I first learnt from, but I can't see it right now.
The one that I think I first learnt dplyr from is
https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html
Both the above have formatted notes that can be printed.
The cheat sheet that Brooke mentioned is at:
https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf