1 Introduction

This online tutorial for MATH 342 is meant to provide a review of basic R syntax, including plotting functions.

You should install R from https://cran.r-project.org/. I highly advise that you also install the RStudio IDE to facilitate your analysis. If you have never touched R, find a tutorial online to grasp the basics of the programming language, for example Wickham’s R for Data Science book. Many websites provide overview of exploratory data analysis (EDA).

R is a programming language that compiles in real-time, meaning that you can simply type instructions in the console to see them executed.

If you have not used R before, work through some of the introduction at http://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf. If you have used R before, work through some of David S. Stoffer’s examples to get an idea of some of the time series functions. We will use them more systematically in future weeks.

I will heavily focus on some time series libraries that are not part of the base or stat. The latter are the default libraries that are installed alongside with the base R. They contain ts, acf, etc. These standard tools are very useful, except that they do not handle irregular time series or missing values. These functions will likely not be altered (or improved) in the future for reproducibility reasons. Many other contributed R libraries are more intuitive and easy to use than the base functions. However, living on the cutting edge means that functions may change or stop working anytime in the future.

The first thing to know about R is how to access help files. If you want to read about time series, type help.search("time series"). If you want to read the help file on a particular function, for example plot, use ?plot or help("plot").