This is a repository with resources to learn some basic R and RMarkdown, using RStudio. Lots of things are possible using these tools, but I will focus on the necessary elements to understand conduct Social Science research. A quick explanation of the name of this repository (i.e. this page and all materials): for some reason there is a tradition in R tools to have punny names. The pronounciation of this repo (short for repository) is "learn" :).
First things first: see instructions on how to download R and RStudio here. The linked page also instructs you to install tidyverse and RSQLite, but this is not necessary. If you prefer a video tutorial, there are a ton on youtube, like this one on installation for Windows 10.
I have added a few scripts and files to play with in this repository. Learning R will always be an ongoing process, and I have added a few resources below to get started, learn more, and keep handy while coding in R.
This repo is a work in progress, and I will add materials as necessary. The following material can be found right now:
In 2018 I gave an introduction to R for RLadies Amsterdam. I've adjusted the assignments and slides for use here.
- intro-base-R.R: script with some very basic R commands, upto creating a dataframe and saving it
- RLadiesAMS_2018May24.pdf: slides with accompanying explanation
- how to read csvs using read.csv and read.csv2
If you have any requests, feel free to let me know via the issues page or by shooting me a message.
Suggested materials for learning
RStudio has an overview cheat sheets with some of the most common code for different tasks. Some of my favorites:
- Cheat sheet base R
- Cheat sheet RStudio IDE
- Cheat sheet RMarkdown
- Cheat sheet Data Visualization using ggplot2
A big part of learning how to code in R is simply learning what to google for. Googling error messages and questions about your code will often lead you to pages like Stack Overflow where people have asked, and hopefully answered, the same questions before.