# Introduction to R

## Tutorial objectives

**The objectives of this tutorial are to:**

- Download and install R
- Download and install RStudio
- Learn the basics of R including:
- basic mathmatical functions
- variable assignment
- installing packages
- loading packages

- Be introduced to data visualization

## Downloading and installing R

The first step is to download and install R, which is freely available and can be accessed here. You can choose any of the “mirrors” you want, but it is best to use the one that is closest to you geographically (e.g., the one at Oregon State University).

## Downloading and installing RStudio

The second step is to download and install Rstudio, which is a very nice integrated development environment (IDE) for R. In a nutshell, it makes working with R much easier. You will want to install the Rstudio Desktop version that is appropriate for your operating system. After you have installed R and Rstudio, you can proceed to the next step.

## Getting started with R

R is a programming language that was developed to help researchers analyze quantitative data (e.g., do statistics). As such, R can be used for conducting both simple mathematical functions and complex statistical analyses. See below for some of the simple things that you can do with R. Note that any code directly preceded with a “#” is ignored by R.

### multiplication:

`5*4`

`## [1] 20`

### division:

`18/32`

`## [1] 0.5625`

### power calculations:

`5^2`

`## [1] 25`