Book contents
- Frontmatter
- Contents
- List of Figures
- List of Tables
- List of Boxes
- Acknowledgments
- 1 Introduction
- PART I R AND BASIC STATISTICS
- 2 Introduction to R
- 3 Looking at Data – Numerical Summaries
- 4 Looking at Data – Tables
- 5 Looking at Data – Graphs
- 6 Transformations
- 7 Missing Values
- 8 Confidence Intervals and Hypothesis Testing
- 9 Relating Variables
- PART II MULTIVARIATE METHODS
- PART III ARCHAEOLOGICAL APPROACHES TO DATA
- References
- Index
2 - Introduction to R
from PART I - R AND BASIC STATISTICS
Published online by Cambridge University Press: 22 July 2017
- Frontmatter
- Contents
- List of Figures
- List of Tables
- List of Boxes
- Acknowledgments
- 1 Introduction
- PART I R AND BASIC STATISTICS
- 2 Introduction to R
- 3 Looking at Data – Numerical Summaries
- 4 Looking at Data – Tables
- 5 Looking at Data – Graphs
- 6 Transformations
- 7 Missing Values
- 8 Confidence Intervals and Hypothesis Testing
- 9 Relating Variables
- PART II MULTIVARIATE METHODS
- PART III ARCHAEOLOGICAL APPROACHES TO DATA
- References
- Index
Summary
R is an open source programming language that includes functions for managing and analyzing data (R Core Team, 2016). It includes extensive graphical and statistical capabilities that are continually being expanded. In addition to the basic installation, there are numerous packages contributed by R users worldwide that provide additional functions. R is freely available worldwide and compiled versions are available for Windows®, Mac OS X®, and several versions of Linux (Debian®, Redhat®, Suse®, and Ubuntu®). In this chapter, you will learn how to install R, type commands, and get help.
FIRST STEPS USING R
The main R Project website is www.r-project.org/ (Figure 1). The main page provides access to information about R and to extensive documentation. Select CRAN under “Download” on the left side of the page. At the top of the page, labeled 0-Cloud, click on https://cloud.r-project.org/. That will take you a secure server near your location to download R. Download the version for your computer's operating system (Windows, OS X, or Linux). The download link for Windows is straightforward. The link for Linux requires you to select which flavor of Linux you are using and then provides instructions for installing the software. The link for Mac OS X is a bit more complicated. Assuming you have a recent version of OS X (10.9 or later), follow the instructions and install XQuartz first and then download the.pkg file to install R.
You interact with R by typing commands and executing them. There are several ways to do this. We will start with the basic interface and then describe some other options at the end of the chapter. When you start R by clicking on the icon, you will see the R Console window (Figure 2). The window includes information on what version of R you are using, how to get help, how to quit, and some basic instructions on how to cite R in publications. Below that is a line beginning with “>” which is R's way of saying it is waiting for you to type a command. The menu bar at the top of the window includes File, Edit, Misc, Packages, Windows, and Help tabs (in Windows®, the OS X® menus are slightly different and the tabs do not appear in the Linux terminal window).
- Type
- Chapter
- Information
- Quantitative Methods in Archaeology Using R , pp. 11 - 35Publisher: Cambridge University PressPrint publication year: 2017