# Data Processing in R, Lecture Notes

*2020-12-08*

# Chapter 1 Getting Started

(08 December, 2020, 00:33)

## 1.1 Initial Remarks

- The purpose of these lecture notes is to allow you to quickly revisit concepts covered in class. On their own, they likely won’t form a sufficient introduction to R.
- In the following, I will draw on the following resources.
- The great introduction materials developed at the University of Glasgow: https://psyteachr.github.io/, in particular ‘Data Skills for Reproducible Science’.
- The also pretty great introduction to R and statistics by Danielle Navarro available here.
- Matt Crump’s ‘Answering Questions with Data’.
- Primers on a variety of topics: https://rstudio.cloud/learn/primers
- Cheat sheets on a variety of topics: https://rstudio.cloud/learn/cheat-sheets

- I also recommend the following tutorials:

## 1.2 Specific useful cheat sheets and primers

## 1.3 Installing and Setting up RStudio

Currently, the most convenient interface to R is the RStudio GUI. You can either install it locally, or use it online on RStudio Cloud.

### 1.3.1 Local RStudio installation

- Typically,
*RStudio*is run on a local computer.

Please download R and RStudio separately from:

- R: https://cran.r-project.org/
- R studio: https://rstudio.com/products/rstudio/download/ (download ‘RStudio Desktop’)

### 1.3.2 RStudio Cloud

You can use the RStudio cloud service for free after getting an account on RStudio Cloud.

## 1.4 Basics of the RStudio environment

Please take a look at the following thorough introduction to the RStudio environment.

Please watch the following video by Lisa DeBruine:

## 1.5 Special blocks in the following

- In the following, R code blocks will appear as follows. The first block shows the R code, the second block the second block (with text in bold), the R output.

`## [1] 21.0 21.0 22.8 21.4 18.7`

- Grey boxes of this type introduce new functions (at least sometimes).

`mean(x)`

Computes the average of a vector of numbers.

`x`

The vector to average over.

## 1.6 Lecture Notes Source Code

- You can always download the most up-to-date version of these lecture notes from github at this URL: https://github.com/plogacev/ling411_lecture_notes_R