R Coding Basics
Overview
In this module, we will talk a bit about writing code in R. This is likely the one unit which will have the greatest diversity in pre-existing knowledge. Some of you might already have enough R knowledge that this will just be a quick refresher.
For those among you who have not used R or any other programming language before, this unit (and everything else related to R in this course) will be time-consuming. Be prepared to put in a good bit of time and effort. Budget your time accordingly and plan ahead! If you do, I’m fairly certain you will find it worth it. If you are not able or willing to allot the time needed to learn enough R to make things work, this course might not be ideal for you.
Learning Objectives
- Gain starting knowledge of R coding
- Become familiar with the
tidyverse - Become familiar with resources that help you learn R
Learning to code
R (or any other programming language) is best learned by “doing it”. You will learn more R as we go along, but the focus of the class is on data analysis, so while I will provide you with resources to figure out the R bits, outside of this module we will not focus on ‘learning R’. You will learn by doing as we go through the course. As with anything, the more you practice, the better you will get. You should approach learning to code with an attitude of fearless curiosity. You will get stuck, you will get frustrated with some weird error message in your code (still happens to me at least once a week), and you will eventually figure it out. Make use of the great resources that are out there. They are all listed below and in the Resources section.
This figure illustrates the journey of learning to write code:
