Skip to main content Accessibility help
×
Hostname: page-component-cd9895bd7-gxg78 Total loading time: 0 Render date: 2024-12-24T08:12:24.660Z Has data issue: false hasContentIssue false

2 - Introduction to R

from PART I - R AND BASIC STATISTICS

Published online by Cambridge University Press:  22 July 2017

David L. Carlson
Affiliation:
Texas A & M University
Get access

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
Publisher: Cambridge University Press
Print publication year: 2017

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Introduction to R
  • David L. Carlson, Texas A & M University
  • Book: Quantitative Methods in Archaeology Using R
  • Online publication: 22 July 2017
  • Chapter DOI: https://doi.org/10.1017/9781139628730.002
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Introduction to R
  • David L. Carlson, Texas A & M University
  • Book: Quantitative Methods in Archaeology Using R
  • Online publication: 22 July 2017
  • Chapter DOI: https://doi.org/10.1017/9781139628730.002
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Introduction to R
  • David L. Carlson, Texas A & M University
  • Book: Quantitative Methods in Archaeology Using R
  • Online publication: 22 July 2017
  • Chapter DOI: https://doi.org/10.1017/9781139628730.002
Available formats
×