1 Introduction
1.1 Goals
- Learn good data handling and coding practices.
- Develop skills necessary to analyze & visualize collected data.
- Learn enough of the basics to allow you to develop and troubleshoot your own code.
- Develop the independence and confidence to tackle any project.
- Get super hyped about R.
1.2 Agenda
- Introduction to programming principles
- R
base
-ics & thetidyverse
- Principles of data visualization
- Statistics & experimental design
- Build something fun
1.2.1 Notes
- We have four morning sessions to cover the material in Part I.
- Please, ask questions as we go along.
- Exactly how much of this material we are able to cover will depend on the pace that we work through this – but we don’t have to get to all of it – that is why having this tutorial will be useful.
- There will be short exercises that I have called challenges that we will do along the way. The best way to learn R is through doing it, so these sorts of exercises are essential.
- We will take at least a 5 minute break every hour.
1.3 Disclaimer
The following workshop contains my opinions on learning R and programming in general – I have a bad habit of collecting opinions on things. I am by no means an expert in anything, including this (i.e. coding, statistics, science, teaching, life, etc.). So please feel free to disagree with any and all of the opinions in this document. In fact, one of my opinions is that informed disagreement is pivotal to becoming an independent thinker! So the way I think about it, the more you disagree with me, the better I taught you. Try disagreeing with that one! I’ve got you in a Catch 22.
This workshop is designed to give you some exposure to the wide variety of tools that are available in R and Data Science in general. It is almost by necessity incomplete. My goal with this workshop is that by providing you with some exposure to these topics, you can go out into the world wide web and collect more tools.
Very little – if any – of this workshop is uniquely mine. Instead, I have basically compiled a bunch of useful nuggets of information and tips from other places. I have packaged those nuggets here to fit within the scope this workshop. But, I strongly encourage you to check out those alternative1 resources. They are linked below and throughout this document. Thus, this tutorial will be useful – if through nothing else – as a portal to more useful parts of the internet.
1.4 Alternative resources
- Google – when in doubt, Google it out
- R for Data Science – a wonderfully thorough and useful book that emphasizes the tidyverse
- R for Graduate Students – very accessible introduction to R & the tidyverse
- YaRrr! The Pirate’s Guide to R – fun take on learning mostly base R
- Fundamentals of Data Visualization – “A guide to making visualizations that accurately reflect the data, tell a story, and look professional.” by Claus O. Wilke. This book is great, because it is not at all about programming, but just how to make the best data visualizations.
- Advanced R – R with the nitty-gritty details for the super nerds out there.
ggplot2
book – detailed introduction to plotting withggplot2
- Learning Statistics with R – there is also a newer version that is in development that emphasizes the tidyverse.
- R Markdown: The Definitive Guide – great overview of the features of R Markdown
- R Markdown Cookbook – additional R Markdown guide
- Happy Git and GitHub for the useR – resource for version control
- Nick Gotelli’s Computational Biology – a wonderful course on R taught by Nick Gotelli at UVM.
1.5 Stolen advice
- Stand on the shoulders of giants. – Issac Newton
- If Issac Newton did it, then it’s not cheating. Other people have probably tried something close to what you are about to do. Find it. Use it. Build on it.
- Move fast and break things. – Facebook
- While perhaps a terrible motto for one of the most powerful companies ever created on the planet, it’s not bad advice for coding. Just try stuff out. See what works. See what doesn’t. Make it your own. Break it. Move on and try something else.
- If you can dream it. You can do it. – Walt Disney – or at least some guy that worked in marketing for Walt Disney’s company after he died – whatever.
- Be creative. Think up your dream data analysis and visualization and make it happen. Sketch it out, erase it, and turn it into Mickey Mouse.
- Whatever you do, do it with intention. – Embroidered throw pillow in my aunt’s beach house.2
- Think about your decisions and have a reason for each choice. Why this statistical analysis? Why this line of code? Why use this argument in this function? Why this package? Why this visualization? Why this color? Why this theme? Have an answer. Make deliberate and defensible choices.
1.6 R Script download
Link to download R script that I created while we walked through Part I of the workshop together.