ABSTRACT

R provides a powerful environment for selecting probability samples and analyzing survey data. The base R system includes thousands of functions for computing statistics, and user-contributed packages for this open-source software provide thousands more. The RStudio® integrated development system provides a user-friendly graphical interface.

This chapter provides a tutorial for getting started with R and RStudio, showing how to obtain the free software, install and use contributed packages, perform basic operations on data, and import data from external data files. Examples illustrate how to save output and graphics that are produced by R so they can be pasted into word-processing programs, and how to embed R code and output into LaTeX.

The following chapters show, through examples, how to use functions in base R and contributed packages to select probability samples and to analyze and graph complex survey data.