1 Introduction to R


This chapter covers

  • Installing R and RStudio
  • Understanding the R language
  • Running programs

In recent years, how we analyze data has changed dramatically. With the advent of personal computers and the internet, the sheer volume of data we have available has grown enormously. Companies have terabytes of data about the consumers they interact with, and governmental, academic, and private research institutions have extensive archival and survey data on every manner of research topic. Gleaning information (let alone wisdom) from these massive stores of data has become an industry in itself. At the same time, presenting the information in easily accessible and digestible ways has become increasingly challenging.

The science of data analysis (statistics, psychometrics, econometrics, and machine learning) has kept pace with this explosion of data. Before personal computers and the internet, academic researchers developed new statistical methods that they published as theoretical papers in professional journals. It could take years for programmers to adapt these methods and incorporate them into the statistical packages that were widely available to data analysts. Now new methodologies are appearing daily. Statistical researchers publish new and improved methods, along with the code to produce them, on easily accessible websites.

1.1 Why use R?

1.2 Obtaining and installing R

1.3 Working with R

1.3.1 Getting started

1.3.2 Using RStudio

1.3.3 Getting help

1.3.4 The workspace

1.3.5 Projects

1.4 Packages

1.4.1 What are packages?

1.4.2 Installing a package

1.4.3 Loading a package

1.4.4 Learning about a package

1.5 Using output as input: Reusing results

1.6 Working with large datasets

1.7 Working through an example