100% found this document useful (1 vote)
71 views

Full Download Getting Started with R: An Introduction for Biologists 2nd Edition Andrew Beckerman PDF DOCX

Introduction

Uploaded by

aistesietzt9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
71 views

Full Download Getting Started with R: An Introduction for Biologists 2nd Edition Andrew Beckerman PDF DOCX

Introduction

Uploaded by

aistesietzt9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Getting Started with R: An Introduction for


Biologists 2nd Edition Andrew Beckerman

https://textbookfull.com/product/getting-started-with-r-an-
introduction-for-biologists-2nd-edition-andrew-beckerman/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Getting Started with Kubernetes 2nd Edition Baier

https://textbookfull.com/product/getting-started-with-kubernetes-2nd-
edition-baier/

textboxfull.com

Getting Started With Angular 2nd Edition Stephen Adams

https://textbookfull.com/product/getting-started-with-angular-2nd-
edition-stephen-adams/

textboxfull.com

Make Getting Started with Processing A Hands On


Introduction to Making Interactive Graphics 2nd Edition
Casey Reas
https://textbookfull.com/product/make-getting-started-with-processing-
a-hands-on-introduction-to-making-interactive-graphics-2nd-edition-
casey-reas/
textboxfull.com

Getting Started with PhantomJS Beltran Aries

https://textbookfull.com/product/getting-started-with-phantomjs-
beltran-aries/

textboxfull.com
Getting Started With Raspberry Pi An Introduction to the
Fastest Selling Computer in the World 3rd Edition Wallace

https://textbookfull.com/product/getting-started-with-raspberry-pi-an-
introduction-to-the-fastest-selling-computer-in-the-world-3rd-edition-
wallace/
textboxfull.com

Getting Started with Gulp - Second Edition Travis Maynard

https://textbookfull.com/product/getting-started-with-gulp-second-
edition-travis-maynard/

textboxfull.com

Make Getting Started with Processing py Allison Parrish

https://textbookfull.com/product/make-getting-started-with-processing-
py-allison-parrish/

textboxfull.com

Getting Started with EEG Neurofeedback John N. Demos

https://textbookfull.com/product/getting-started-with-eeg-
neurofeedback-john-n-demos/

textboxfull.com

Introduction to Bioinformatics with R A Practical Guide


for Biologists Chapman Hall CRC Computational Biology
Series 1st Edition Edward Curry
https://textbookfull.com/product/introduction-to-bioinformatics-with-
r-a-practical-guide-for-biologists-chapman-hall-crc-computational-
biology-series-1st-edition-edward-curry/
textboxfull.com
Getting Started with R
Getting Started
with R
An Introduction for
Biologists
Second Edition

ANDREW P. BECKERMAN
DYL AN Z. CHILDS

Department of Animal and Plant Sciences,


University of Sheffield

O W E N L . P E TC H E Y

Department of Evolutionary Biology


and Environmental Studies,
University of Zurich

3
3
Great Clarendon Street, Oxford, OX2 6DP,
United Kingdom
Oxford University Press is a department of the University of Oxford.
It furthers the University’s objective of excellence in research, scholarship,
and education by publishing worldwide. Oxford is a registered trade mark of
Oxford University Press in the UK and in certain other countries
© Andrew Beckerman, Dylan Childs, & Owen Petchey 2017
The moral rights of the authors have been asserted
First Edition published in 2012
Second Edition published in 2017
Impression: 1
All rights reserved. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form or by any means, without the
prior permission in writing of Oxford University Press, or as expressly permitted
by law, by licence or under terms agreed with the appropriate reprographics
rights organization. Enquiries concerning reproduction outside the scope of the
above should be sent to the Rights Department, Oxford University Press, at the
address above
You must not circulate this work in any other form
and you must impose this same condition on any acquirer
Published in the United States of America by Oxford University Press
198 Madison Avenue, New York, NY 10016, United States of America
British Library Cataloguing in Publication Data
Data available
Library of Congress Control Number: 2016946804
ISBN 978–0–19–878783–9 (hbk.)
ISBN 978–0–19–878784–6 (pbk.)
DOI 10.1093/acprof:oso/9780198787839.001.0001
Printed and bound by
CPI Litho (UK) Ltd, Croydon, CR0 4YY
Links to third party websites are provided by Oxford in good faith and
for information only. Oxford disclaims any responsibility for the materials
contained in any third party website referenced in this work.
Contents
Preface ix
Introduction to the second edition ix
What this book is about xii
How the book is organized xiv
Why R? xvi
Updates xviii
Acknowledgements xviii

Chapter 1: Getting and Getting Acquainted with R 1


1.1Getting started 1
1.2Getting R 2
1.3Getting RStudio 5
1.4Let’s play 6
1.5Using R as a giant calculator (the size of your computer) 8
1.6Your first script 15
1.7Intermezzo remarks 21
1.8Important functionality: packages 21
1.9Getting help 24
1.10A mini-practical—some in-depth play 26
1.11Some more top tips and hints for a successful first
(and more) R experience 28
Appendix 1a Mini-tutorial solutions 29
Appendix 1b File extensions and operating systems 30

Chapter 2: Getting Your Data into R 35


2.1 Getting data ready for R 35
2.2 Getting your data into R 40
2.3 Checking that your data are your data 45
2.4 Basic troubleshooting while importing data 48
2.5 Summing up 49
Appendix Advanced activity: dealing with untidy data 50
vi CONTENTS

Chapter 3: Data Management, Manipulation, and Exploration


with dplyr 57
3.1 Summary statistics for each variable 58
3.2 dplyr verbs 59
3.3 Subsetting 60
3.4 Transforming 67
3.5 Sorting 68
3.6 Mini-summary and two top tips 69
3.7 Calculating summary statistics about groups of your data 70
3.8 What have you learned . . . lots 73
Appendix 3a Comparing classic methods and dplyr 73
Appendix 3b Advanced dplyr 74

Chapter 4: Visualizing Your Data 79


4.1 The first step in every data analysis—making a picture 79
4.2 ggplot2: a grammar for graphics 80
4.3 Box-and-whisker plots 85
4.4 Distributions: making histograms of numeric variables 87
4.5 Saving your graphs for presentation, documents, etc. 90
4.6 Closing remarks 91

Chapter 5: Introducing Statistics in R 93


5.1 Getting started doing statistics in R 93
5.2 χ 2 contingency table analysis 95
5.3 Two-sample t-test 103
5.4 Introducing . . . linear models 108
5.5 Simple linear regression 109
5.6 Analysis of variance: the one-way ANOVA 118
5.7 Wrapping up 128
Appendix Getting packages not on CRAN 128

Chapter 6: Advancing Your Statistics in R 131


6.1 Getting started with more advanced statistics 131
6.2 The two-way ANOVA 131
6.3 Analysis of covariance (ANCOVA) 145
6.4 Overview: an analysis workflow 164

Chapter 7: Getting Started with Generalized Linear Models 167


7.1 Introduction 167
7.2 Counts and rates—Poisson GLMs 170
CONTENTS vii

7.3 Doing it wrong 173


7.4 Doing it right—the Poisson GLM 177
7.5 When a Poisson GLM isn’t good for counts 194
7.6 Summary, and beyond simple Poisson regression 201

Chapter 8: Pimping Your Plots: Scales and Themes in ggplot2 203


8.1 What you already know about graphs 203
8.2 Preparation 204
8.3 What you may want to customize 206
8.4 Axis labels, axis limits, and annotation 207
8.5 Scales 209
8.6 The theme 212
8.7 Summing up 218

Chapter 9: Closing Remarks: Final Comments and


Encouragement 219
General Appendices 223
Appendix 1 Data Sources 223
Appendix 2 Further Reading 224
Appendix 3 R Markdown 225

Index 227
Preface

Introduction to the second edition

This is a book about how to use R, an open source programming language


and environment for statistics. It is not a book about statistics per se, but a
book about getting started using R. It is a book that we hope will teach you
how using R can make your life (research career) easier.
Several years ago we published the first edition of this book, aiming to
help people move from ‘hearing about R’ to ‘using R’. We had realized
that there were lots of books about exploring data and doing statistics with
R, but none specifically designed for people that didn’t have a lot of ex-
perience or confidence in using much more than a spreadsheet, people
that didn’t have a lot of time, and people that appreciated an engaging and
sometimes humorous initial journey into R. The first edition was also de-
signed for people who did know statistics and other packages, but wanted
a quick ‘getting started’ guide, because, well, it is hard to get started with
R in some ways. Overall, we aimed to make the somewhat steep learning
curve more of a walk in the park.
Over the past five years much has changed. Most significantly, R has
evolved as a platform for doing data analysis, for managing data, and for
producing figures. Other things have not changed. People still seem to
need and appreciate help in navigating the process of getting started work-
ing with R. Thus, this new version of the book does two things. It retains
x PREFACE

our focus on helping you get started using R. We love doing this and we’ve
been teaching this for 15 years. Not surprisingly, many of you are also find-
ing that this getting-started book is great for undergraduate and graduate
teaching. We thank you all for your feedback!
Second, we have substantially revised how we use, and thus suggest you
use, R. Our changes and suggestions take advantage of some new and very
cool, efficient, and straightforward tools. We think these changes will help
you focus even more on your data and questions. This is good.
If you compare this second edition with the first, you will find sev-
eral differences. We no longer rely on base R tools and graphics for data
manipulation and figure making, instead introducing dplyr and ggplot2.
We’ve also expanded the set of basic statistics we introduce to you, includ-
ing new examples of a simple regression and a one-way and a two-way
ANOVA, in addition to the old ANCOVA example. Third, we provide an
entire new chapter on the generalized linear model. Oh, yes, and we have
added an author, Dylan.

WHAT ’S SO DIFFERENT FROM THE FIRST EDITION?

We teach a particular workflow for quantitative problem solving: have a


clear question, get the right data for that question, inspect and visualize
the data, use the visualization to reveal the answer to the question, make a
statistical model that reflects your question, check the assumptions of the
model, interpret the model to confirm or refute your answer, and clearly
and beautifully communicate your answer in a figure.
In R there are many different tools, and combinations of these tools,
for accomplishing this workflow. In the first edition of this book we intro-
duced a set of ‘classic’ R tools drawn from the base R installation. These
classic tools worked and, importantly, continue to work very well. We
taught them in our courses for years. We used them in our research for
years. We still use them sometimes. And as you start to use R, and interact
with people using R, and perhaps share code, you will find many people
using these classic tools and methods.
PREFACE xi

But the tools and their syntax were designed a long time ago. Many em-
ploy a rather idiosyncratic set of symbols and syntax to accomplish tasks.
For example, square brackets are used for selecting parts of datasets, and
dollar signs for referring to particular variables. Sometimes different tools
that perform similar tasks work in very different ways. This makes for ra-
ther idiosyncratic instructions that are not so easy for people to read or to
remember how to write.
So after much deliberation, and some good experiences, we decided
that in this second edition we would introduce a popular and new set of
tools contributed by Sir1 Hadley Wickham and many key collaborators
(http://had.co.nz). These new tools introduce a set of quite stand-
ardized and coherent syntax and exist in a set of add-on packages—you
will learn exactly what these are and how to use them later. And you will
also learn some base R. In fact, you will learn a great deal of base R.
We decided to teach this new way of using R because:

• The tools use a more ‘natural language’ that is easier for humans to
work with.
• The standardization and coherence among the tools make them easy
to learn and use.
• The tools work very well for simple and small problems, but also scale
very intuitively and naturally to quite complex and large problems.
• There are tools for every part of the workflow, from data management
to statistical analysis and making beautiful graphs.
• Each of us independently migrated to this new set of tools, giving
us greater confidence that it’s the way forward. (Well, Andrew was
forced a bit.)

Though we are confident that teaching newcomers these new tools is the
right thing to do, there are some risks and, in particular, people taught only
these new tools may not be able to work easily with people or code using

1
Unofficial knighthood for contributions to making our R-lives so much easier and
beautiful.
xii PREFACE

the classic way. Furthermore, some colleagues have questioned the wis-
dom of teaching this ‘modern’ approach to entry-level students (i.e. those
with no or little previous experience with R), especially if taught in the ab-
sence of the classic approach (funnily enough, many of these ‘concerned’
colleagues don’t use R at all!). Certainly the risks mentioned above are real,
and for that reason we provide a short appendix in Chapter 3 (the chapter
on Data management) that links the classic and new methods. The classic
way can still sometimes be the best way. And old dogs don’t often agree to
learning new tricks.
Another concern voiced asks why we’re teaching ‘advanced R’ at entry
level, with the idea that the use of new tools and add-on packages im-
plies ‘advanced’. After all, why wouldn’t the ‘base’ R distribution contain
everything an entry-level user needs? Well, it does, but we’ve found the
standardization and syntax in the add-on packages to be valuable even for
us as seasoned users. And one should not read ‘base’ R distribution as ‘ba-
sic’ R distribution, or ‘add-on’ package as ‘advanced’ package. The ‘base’
distribution contains many advanced tools, and many add-on packages
contain very basic tools.
We hope you enjoy this new Getting Started with R.

What this book is about

We love R. We use statistics in our everyday life as researchers and teach-


ers. Sometimes even more: Owen used it to explore the nursing behaviour
of his firstborn. We are first and foremost evolutionary and community
ecologists, but over the past 15 years we have developed, first in parallel
and then together, an affinity for R. We want to share our 40+ years of
combined experience using R to show you how easy, important, and ex-
citing it can be. This book is based on 3–5-day courses we give in various
guises around the world. The courses are designed to give students and
staff alike a boost up the steep initial learning curve associated with R.
We assume that course participants, and you as readers, already use
some spreadsheet, statistical, and graphing programs (such as Excel, SPSS,
PREFACE xiii

Minitab, SAS, JMP, Statistica, and SigmaPlot). Most participants, and we


hope you, have some grasp of common statistical methods, including
the chi-squared test, the t-test, and ANOVA. In return for a few days
of their lives, we give participants knowledge about how to easily use R,
and R only, to manage data, make figures, and do statistics. R changed
our research lives, and many participants agree that it has done the same
for them.
The efforts we put into developing the course and this book are, how-
ever, minuscule compared with the efforts of the R Core Development
Team. Please remember to acknowledge them and package contributors
when you use R to analyse and publish your amazing findings.

WHAT YOU NEED TO KNOW TO MAKE THIS BOOK WORK


FOR YOU

There are a few things that you need to know to make this book, and our
ideas, work for you. Many of you already know how to do most of these
things, having been in the Internet age for long enough now, but just to
be sure:

1. You need to know how to download things from the Internet. If you
use Windows, Macintosh, or Linux, the principles are the same, but
the details are different. Know your operating system. Know your
browser and know your mouse/trackpad.
2. You need to know how to make folders on your computer and save
files to them. This is essential for being organized and efficient.
3. It is useful, though not essential, to understand what a ‘path’ is on
your computer. This is the address of a folder or a file (i.e. the path
to a file). On Windows, depending on the type you are using, this in-
volves a drive name, a colon (:), and slashes (\ or /). On a Macintosh
and Linux/Unix, this requires the names of your hard drive, the
name of your home directory, a tilde (~), the names of folders, and
slashes (/).
xiv PREFACE

4. Finally, you need at least a basic understanding of how to do, and


why you are doing, statistics. We recommend that you know the
types of questions a t-test, a chi-squared test, linear regression,
ANOVA, and ANCOVA are designed to help you answer before you
use this book. As we said, we are not aiming to teach you statistics per
se, but how to do some of the most common plotting and most fre-
quent statistics in R, and understand what R is providing as output.
That said, we’ll try and teach a bit along the way.

How the book is organized

In this book, we will show you how to use R in the context of everyday re-
search in biology (or, indeed, in many other disciplines). Our philosophy
assumes that you have some data and would like to derive some under-
standing from it. Typically you need to manage your data, explore your
data (e.g. by plotting it), and then analyse your data. Before any attempt at
analysis, we suggest (no, demand!) that you always plot your data. As al-
ways, analysing (modelling) your data involves first developing a model
that accurately reflects your question, and then testing critical assump-
tions associated with the statistical method (model). Only after this do
you attempt interpretation. Our focus is on developing a rigorous and ef-
ficient routine (workflow) and a template for using R for data exploration,
visualization, and analysis. We believe that this will give you a functional
approach to using R, in which you always have the goal (understanding
your data, answering your question) in mind.
Chapter 1 is about getting R and getting acquainted with it. The chap-
ter is a bit like when you first meet someone who might be your friend,
or might not, so you take some time to get to know each other. We also
introduce you to another friend, RStudio, and strongly recommend that
you get to know this one, as well as R. RStudio is just great. You will fall in
love with it.
Chapter 2 is about getting your data ready for R, getting it into R, and
checking it got into R correctly. Not many courses cover data preparation
PREFACE xv

as much as in this chapter, but it’s really essential for an efficient experience
with R. Good preparation makes for great performance. We give tips about
what can go wrong here, how to recognize this, and how to fix it.
Chapter 3 focuses on how you work with data once it’s in R. Usually
you’ll need to do some data manipulation before making a graph or doing a
statistical analysis. You might need to subset your data, or want to calculate
mean ± SE. We walk you through some very efficient and clear methods
for doing all kinds of data manipulations.
Chapter 4 is about visualizing your data, and comes before the chapters
about statistical analyses because we always visualize our data before we do
any statistics (you will hear that again and again throughout this book).
We introduce you to scatterplots, histograms, and box-and-whisker plots.
In later chapters, we also introduce you to plots of means and standard
errors. (But we do not introduce you to bar charts with error bars, because
they are evil2 .)
Chapters 5, 6, and 7 finally get on to doing some statistics. Chapter 5
introduces ‘basic’ statistical tests (t-test, chi-squared contingency table
analyses, simple linear regression, and the one-way ANOVA). Chapter 6
is slightly more complex tests (two-way ANOVA and ANCOVA). And
Chapter 7 takes us to new territory, where we introduce about the sim-
plest generalized linear model around: a Poisson regression. As we said,
we are introducing how to do stuff in R and we’re not aiming to cover
lots of statistics in great detail, but along the way we try and ensure that
your understanding of statistics maps onto the output you can get from
using R. We’ve added this ‘getting started with generalized linear models’
chapter because so many types of question in the biological sciences de-
mand it. Our goal is that you should have seen enough variety of analysis
methods to be comfortable and confident in moving forward and learning
more yourself.
Chapter 8 comes back to figures and graphs. It is about how to make
your graphs look even more beautiful than they were during the previous

2
http://dx.doi.org/10.1371/journal.pbio.1002128
xvi PREFACE

chapters. Put another way, it’s about pimping your graphs. Making the la-
bels, symbols, colours, shading, sizes, and everything else you might like
to change look beautiful, coordinated, and clear, so readers are amazed by
the clarity with which they can see your findings. It will also give you the
skills and flexibility to make atrocious graphs . . . be careful.
The final chapter 9, wraps all this up and provides encouragement. It is
brief. We figure that by this point, you’ll have had enough of us, and will be
raring to get your own data into R. And that is great, because that is when
you’ll really solidify your learning.

SOME CONVENTIONS IN THE BOOK

We have attempted to be consistent in the typefaces and colours of text in


the book, so that you can easily recognize different types of R command. So
the text is rather colourful. Hopefully, the advantages of clarity about what
is what will outweigh any concerns you might have about colour choices.
Throughout the book, we highlight where you can work along with us
on your own computer using R, through the use of the symbol at the side
of the page.
Finally, all of the datasets we use are available online at
http://www.r4all.org/the-book/datasets/.

Why R?

If you’ve got this far, you probably know you want to learn R. Some of you
will have established research careers based around using a variety of stat-
istical and graphing packages. Some of you will be starting your research
career and wondering whether you should use some of the packages and
applications that your supervisor/research group uses, or jump ship to R.
Perhaps your group already uses R and you are just looking for that ‘get-
ting started’ book that answers what you think are embarrassing questions.
Regardless of your stage or background, we think an informal but struc-
tured introduction to an approach and routine for using R will help. And
regardless of the motivation, we finish the Preface here by introducing a
PREFACE xvii

core set of features and characteristics of R that we think make it worth


using and worth making a transition to from other applications.
First, we think you should invest the effort because it is freely available
and cross-platform (e.g. it works on Windows, Macs (OS X), and Linux).
This means that no matter where you are and with whom you work, you
can share data, figures, analyses, and, most importantly, the instructions
(also known as scripts and code) used to generate the figures and analyses.
Anyone, anywhere in the world, with any kind of Windows, Macintosh, or
Linux operating system, can use R, without a licence. If you, your depart-
ment, or your university invest heavily in multiple statistical packages, R
can save a great deal of money. When you change institutions, R doesn’t
become inaccessible, get lost, or become unusable.
Second, R is an interpreted programming language. It does not involve
extensive use of menus; you type commands instead. As a result, you have
to know what to ask R, know why you are asking R for this, and know what
to expect from R. You can’t just click on menus and get some results. This
means that by using R, you continually learn a great deal about statistics
and data analysis.
Third, it’s free. Oh, we said that already. Actually, it’s more accurate to
state that it’s freely available. Lots of people put an awful lot of effort into
developing R . . . that effort wasn’t free. Please acknowledge this effort by
citing R when you use it.
Fourth, we believe that R can replace common combinations of pro-
grams that you might use in the process of analysing your data. For
example, we have, at times, used two or three of Excel, Minitab, SAS, Systat,
JMP, SigmaPlot, and CricketGraph, to name a few. This results in not only
costly licensing of multiple programs, but also software-specific files of
various formats, all floating around in various places on your computer
(or desk) that are necessary for the exploration, plotting, and analysis that
make up a research project. Keeping a research project organized is hard
enough without having to manage multiple files and file types, proprietary
data formats, and the tools to put them all together. Furthermore, mov-
ing data between applications introduces extra steps into your workflow.
And how much fun is it piecing all of this together 3–6 months after
xviii PREFACE

submitting a manuscript, and needing to make changes? These steps and


frustrations are removed by investing in using R.
Fifth, with R you can make outstanding publication-quality and
publication-ready figures, and export them in many different formats, in-
cluding pdf. We now use only R for making graphs, and when submitting
manuscripts to journals we usually send only pdf files generated directly
from R. One of the nice things about pdfs is that they are resolution in-
dependent (you can zoom in as far as you like and they don’t get blocky).
This means that publishers have the best possible version of your figure.
And if the quality is poor in the published version of your paper, you know
it is down to something the publishers have done!
Finally, and quite importantly, R makes it very easy to write down and
save the instructions you want R to execute—this is called a script in R.
In fact, the script becomes a permanent, repeatable, annotated, cross-
platform, shareable record of your analysis. Your entire analysis, from
transferring your data from field or lab notebook to making figures and
performing analyses, is all in one, secure, repeatable, annotated place.
Take your time and learn the magic of R. Let’s get started.

Updates

Rstudio evolves quickly, so don’t worry if what you see on your computer
is a little different from what’s printed in this book. For example, as this
book went to press, RStudio started using a new method for importing
data. We quickly updated the most important parts of the book, but for
a full account of this change, and any others, look on the book web site
www.r4all.org/the-book.

Acknowledgements

Thanks to our wives, Sophie, Amanda, and Sara, for everything. After all
these years, they know about R too. Many thanks to Ian Sherman and Lucy
Nash at OUP for their guidance, support and encouragement, to Douglas
Meekison for excellent copy-editing, and Philip Alexander for patiently
dealing with countless “final” fixes!
1
Getting and Getting
Acquainted with R

1.1 Getting started

One of the most challenging bits of getting started with R is actually


getting R, installing it, and understanding how it works with your com-
puter. Despite R’s cross-platform capacity (OSX, Windows, Linux, Unix),
there remain several differences in how things can look on each platform.
Thankfully, a new application, RStudio, provides a way to standardize
most of what you see and do with R, once it is on your computer. In this
chapter, we’ll walk you through the steps of getting R and RStudio, install-
ing them on your computer, understanding what you’ve done, and then
working through various aspects of using R and RStudio.
This introduction will make you feel comfortable using R, via RStudio.
It will make you understand that R is a giant calculator that does whatever
you ask it to do (within reason). It will also familiarize you with how R
does things, both ‘out of the box’ and via additional ‘add-on’ packages that
make R one of the most fun and widely used programs for doing statistics
and visualizing data.

Getting Started with R Second Edition. Andrew Beckerman, Dylan Childs, & Owen Petchey:
Oxford University Press (2017). © Andrew Beckerman, Dylan Childs, & Owen Petchey.
DOI 10.1093/acprof:oso/9780198787839.001.0001
2 GETTING STARTED WITH R

We will first walk you through getting and installing R and getting and
installing RStudio. While for many this will be trivial, our experience sug-
gests that many of you probably need a tiny bit of hand-holding every once
and a while.

1.2 Getting R

We assume you don’t yet have R on your computer. It will run on


Macintosh, Windows, Linux, and Unix operating systems. R has a
homepage, r-project.org, but the software itself is located for
download on the Comprehensive R Archive Network (CRAN), which you
can find at cran.r-project.org (Figure 1.1).

Figure 1.1 The CRAN website front page, from where you can find the links to
download the R application.
GET TING AND GET TING ACQUAINTED WITH R 3

The top box on CRAN provides access to the three major classes of op-
erating systems. Simply click on the link for your operating system. As we
mentioned in the Preface, R remains freely available.
You’ll hear our next recommendation quite a bit throughout the book:
read the instructions. The instructions will take you through the pro-
cesses of downloading R and installing it on your computer. It might also
make sense to examine some of the Frequently Asked Questions found at
the bottom of the web page. R has been around quite a long time now,
and these FAQs reflect more than a decade of beginners like you asking
questions about how R works, etc. Go on . . . have a look!

1.2.1 L I N U X/U N I X

Moving along now, the Linux link takes you to several folders for flavours
of Linux and Unix. Within each of those is a set of instructions. We’ll as-
sume that if you know enough to have a Linux or Unix machine under
your fine fingertips, you can follow these instructions and take advantage
of the various tools.

1.2.2 WINDOWS

The Windows link takes you to a page with three more links. The link
you want to focus on is ‘base’. You will also notice that there is a link to
the aforementioned R FAQs and an additional R for Windows FAQs. Go
on . . . have a look! There is a tonne of good stuff in there about the various
ways R works on Windows NT, Vista, 8, 10, etc. The base link moves you
further on to instructions and the installer, as shown in Figure 1.2.

1.2.3 M AC I N T O S H

The (Mac) OS X link takes you to a page with several links as well
(Figure 1.3). Unless you are on a super-old machine, the first link is the
one on which you want to focus. It will download the latest version of R
for several recent distributions of OS X and offer, via a .dmg installer, to
put everything where it needs to be. Note that while not required for ‘get-
ting started’, getting the XQuartz X11 windowing system is a good idea;
4 GETTING STARTED WITH R

Figure 1.2 Two steps to download the Windows version of R.

Figure 1.3 The download page for R for Macintosh.


GET TING AND GET TING ACQUAINTED WITH R 5

a link is provided just below the paragraph describing the installer (see
Figure 1.3). As with Windows, the R FAQs and an additional R for OS X
FAQs are provided . . . they are good things.

1.3 Getting RStudio

So, at this stage, you should have downloaded and installed R. Well done!
However, we are not going to use R directly. Our experience suggests that
you will enjoy your R-life a lot more if you interact with R via a different
program, also freely available: the software application RStudio. RStudio is
a lovely, cross-platform application that makes interacting with R quite a
bit easier and more pleasurable. Among other things, it makes importing
data a breeze, has a standardized look and feel on all platforms, and has
several tools that make it much easier to keep track of the instructions you
have to give R to make the magic happen.

Figure 1.4 The RStudio website front page, from where you can find the links
to download the RStudio application. (Note: you must (as you have done) also
download the R application from the CRAN website.)
6 GETTING STARTED WITH R

We highly recommend you use RStudio to get started (we use it in


teaching and in our research; Figure 1.4). You can read all about it here:
https://www.rstudio.com. You can download RStudio here:
https://www.rstudio.com/products/rstudio/download/.
At this point, you should have downloaded and installed R, and down-
loaded and installed RStudio.

1.4 Let’s play

You are now ready to start interacting with R. RStudio is the application
we will use. In the process of installing RStudio, it went around your hard
drive to find the R installation. It knows where R is. All we need to do now
is fire up RStudio.
Start RStudio. Of course, you need to know where it is, but we assume
you know how to find applications via a ‘Start’ menu, or in the Applications
folder or via an icon on the desktop or in a dock . . . however you do this,
navigate to RStudio, and start it up. You are clever. You know how to start
an application on your computer!
When we teach, several people end up opening R rather than RStudio.
The RStudio icon looks different from the R icon. Make sure you are start-
ing RStudio (Figure 1.5). If all has gone to plan, the RStudio application

Figure 1.5 The R and RStudio icons are different. You want to be using the
RStudio application.
GET TING AND GET TING ACQUAINTED WITH R 7

Figure 1.6 The RStudio application initiates the first time you open it with three
panes. Left is the Console; top right is a pane with two tabs, Environment and History;
and bottom right is a pane with five tabs, Files, Plots, Packages, Help, and Viewer.
These are explained in detail in the main text.

will, at its very first start, give you three panes (Figure 1.6).1 Let’s walk
through them.
On the left is the Console pane. This is the window that looks into the
engine of R. This is the window where you can give instructions to R, they
are worked on by the little people inside R that are really smart and talk in
a language of 1s and 0s, and then the answer appears back in the Console
pane. It is the brain. The mind. The engine.
The top right is a pane with two tabs: Environment and History. The
Environment pane shows the things that R has in its head. This could be

1
If you have used RStudio already, it might be showing four panes; don’t worry. In what
follows, work with the lower left pane, the console.
8 GETTING STARTED WITH R

datasets, models, etc. It will probably be empty at the moment, but you
will soon start to fill it up. The Environment pane also contains a very
important button: Import Dataset. We will cover the use of this extensively
in Chapter 3. The History pane contains the instructions R has run.
Bottom right is a pane with five tabs: Files, Plots, Packages, Help, and
Viewer. They are rather self-explanatory, and as we begin to use RStudio as
our interface for R, feel free to watch what shows up in each.
When you start RStudio, the Console gives some useful information
about R, its open source status, etc. But, for new users, the most important
is at the bottom, where you will see the symbol > with a cursor flashing
after it. This is known as the prompt.
You can only type instructions in one place in the Console, and that is
at the prompt. Try giving R your first instruction. Click in the Console and
type 1 + 1 and then press enter/return. You should see something like this
(though there will not be two # characters at the start of the answer line):
1 + 1

## [1] 2

The instruction we gave to R was a question: ‘Please, can you give us the
answer to what is one plus one?’ and R has given back the answer
[1] 2
You can read this as R telling you that the first (and only, in this case) part
of the answer is 2. The fact that it’s the first part (indicated by the one in
square brackets) is redundant here, since your question only has a one-part
answer. Some answers have more than one part.
After the answer is a new line with the prompt. R is again ready for an
instruction/question.

1.5 Using R as a giant calculator (the size


of your computer)

What else can R do, other than add one and one? It is a giant calculator,
the size of your computer. As befits a statistical programming language,
it can divide, multiply, add, and subtract; it conforms to this basic order
GET TING AND GET TING ACQUAINTED WITH R 9

too (DMAS). It can also raise to powers, log numbers, do trigonometry,


solve systems of differential equations . . . and lots of other maths. Here
are some simple examples. Let’s go ahead and type each of these into the
Console, pressing enter/return after each to see the answer:

2 * 4
## [1] 8
3/8
## [1] 0.375
11.75 - 4.813
## [1] 6.937
10^2
## [1] 100
log(10)
## [1] 2.302585
log10(10)
## [1] 1
sin(2 * pi)
## [1] -2.449294e-16
7 < 10
## [1] TRUE

In these blocks of R in this book the ## lines are answers from R. Don’t type them in.

Pretty nice. There are a few things worth noting here—some ‘default’ be-
haviours hard-wired into R. These are important, because not all statistical
software or spreadsheet software like Excel handles things the same way:

• If you understand and use logarithms, you might be puzzled by the


result of log(10), which gives 2.30. In R, log(x) gives the natural log
of x, and not the log to base 10. This is different from other software,
which often uses ln() to give the natural log. In R, to make a log to
base 10, use log10(x). See, in the example, log10(10) = 2. You can use
log2() for the log to base 2.
• The trigonometric function sin() works in radians (not degrees) in R.
So a full circle is 2 × π radians (not 360 degrees).
• Some mathematical constants, such as π , are built into R.
• The answer to sin(2*pi) should be zero, but R tells us it is very close to
zero but not zero. This is computer mumbo-jumbo. The people that
10 GETTING STARTED WITH R

built R understand how computers work, so they made a function


called sinpi() that does the ‘multiply by π’ bit for you—sinpi(2) does
equal zero.
• We sometimes didn’t include any spaces in the instructions (e.g.
there were no spaces around pi). It would not have mattered if we
had, however. R ignores such white space. It ignores all white space
(spaces, new lines, and tabs).
• The last question is ‘is 7 less than 10?’ R gets this right, with the an-
swer ‘TRUE’. The ‘less than’ sign is known as a ‘logical operator’.
Others include == (are two things equal?), != (are two things not
equal?), > (is the thing on the left greater than the thing on the right?),
<= (less than or equal to), >= (greater than or equal to), | (the verti-
cal bar symbol, not a big i or a little L; is one or the other thing true?),
and & (are two things both true?).

If you were watching carefully too, you will have noticed that RStudio
is very nice to you, pre-placing closing brackets/parentheses where neces-
sary. Super-nice.
We’ve also just introduced you to a new concept: functions like log10(),
log(), and sin(). Box 1.1 explains more about what functions are. Dip into
it at your pleasure!

1.5.1 F R O M T H E S I M P L E T O T H E S L I G H T LY M O R E C O M P L E X

All of the maths above gave just one answer. It’s the kind of maths you’re
probably used to. But R can answer several questions at once. For ex-
ample, we can ask R ‘Would you please give us the integers from 1 to 10,
inclusive?’ We can do this two ways. Let’s start with the easy way:

1:10

## [1] 1 2 3 4 5 6 7 8 9 10

The answer to our question has ten elements. But hang on, there is
only [1] in front of everything. Fret not, as R is being brief here. It has
Exploring the Variety of Random
Documents with Different Content
—— Sir Joshua, i. 68, 85, 139, 150, 158, 164, 442; ii. 180, 184, 189,
208; iii. 261; iv. 349, 373; v. 18; vi. 9, 12, 21, 30, 45, 47 n., 80–82,
158 n., 169, 201, 209, 214, 270, 296 n., 302, 322, 340, 348–9, 353,
358, 360–1, 366–8, 370, 374–5, 381, 389, 391, 397, 398, 400–3,
406–8, 411, 414, 420, 431, 436–8, 440, 442, 444–5, 448–51, 453,
455, 459, 460, 465, 504, 521; vii. 40, 56, 61, 89, 98, 103–4, 107,
110–3, 115, 163, 239, 253 n., 275, 306; viii. 141, 143–5, 273, 284; ix.
15, 23, 24, 26, 55, 61, 74, 226, 238, 316, 317, 327, 329, 332–3, 338,
344, 346, 360, 379, 380, 393–6, 409, 418–20, 424–6, 470, 472,
474, 478, 482, 483; x. 63, 172, 291, 300, 345, 353; xi. 200, 202,
203, 208, 253, 255, 462, 517, 543; xii. 33, 36, 196, 207, 221, 293,
356, 364, 368.
Reynolds, Sir Joshua, Life of (Farrington’s), x. 172.
—— —— (Cunningham’s), vi. 448.
—— —— (Northcote’s), vi. 415.
—— Discourses on Certain Inconsistencies in Sir Joshua, vi. 122, 131.
—— —— Introduction to an Account of Sir Joshua, xi. 208.
—— Samuel William, vi. 376.
—— Miss, vi. 333, 366, 400, 415, 442; vii. 37.
—— Mr (bookseller), ii. 169, 175.
—— Mr (theatrical manager), xi. 374.
—— (Mrs R——), vii. 37.
Rhea, vii. 255.
Rhesus (Byron’s), xi. 498.
Rhine, iv. 323; ix. 295, 298, 299; xi. 364.
Rhoderic Dhu (Scott’s Lady of the Lake), v. 155.
Rhodope (? Rhododaphne by Peacock), vii. 187 n.
Rhone, The, ix. 182, 281, 282, 289, 294.
Rhymes on the Road (Moore’s), vii. 365, 368; ix. 281, 283.
Rialto, The, ix. 275.
Ribera, Josef, ix. 70, 197; xii. 277.
Ricardo, David, ii. 415; iv. 298; vii. 374; xii. 40.
Ricciardi (Abate), x. 303, 304.
Ricciarelli, Daniele. See Volterra, Daniele da.
Rich, Robert, i. 157; iii. 395.
Richard Monday (Crabbe’s), v. 97.
—— II. (Shakespeare’s), i. 272;
also referred to in i. 123, 294, 297, 300, 312, 387; ii. 59; iii. 209; v.
53, 211, 225; vi. 40, 354, 428; viii. 23, 205; xi. 301.
—— III. (Shakespeare’s), i. 298; viii. 298;
also referred to in i. 14, 15, 171, 192, 193–4, 272, 293, 305, 387,
395; vi. 274, 342; vii. 300; viii. 176, 187, 205–8, 212–3, 358,
378, 472, 514; xi. 191, 207, 352, 399, 410.
—— Cœur de Lion (General Burgoyne’s), viii. 195; x. 54, 55.
—— Varney (Scott’s Kenilworth), iv. 251.
Richards, John Inigo, vi. 414, 444.
Richardson, Jonathan, ii. 201; vi. 10; viii. 464; ix. 397; x. 174, 180,
181.
—— Samuel, i. 138, 227; ii. 128, 130, 171 n.; iii. 157; v. 14, 15; vi. 90,
107, 225, 236, 380, 400, 426, 441, 452; vii. 6 n., 36, 226, 228 n.,
238 n.; viii. 107, 112, 113, 117, 119, 120–21, 153, 555; ix. 64, 434; x.
27, 31, 32, 36, 39, 313, 359; xii. 32, 46, 62, 63, 154, 274, 436.
—— William, i. 171; vi. 413.
Richardson’s London Weekly Review, vi. 505, 513, 514, 517.
Richer, Mr (rope dancer), vi. 79, 81.
Richesse de la Langue, xii. 496.
Richmond, Yorkshire, View of (W. Westall’s), xi. 248.
Richmond, Duke of, ix. 420.
Richmond, Duke of (Shakespeare’s Richard III.), i. 299; viii. 182,
202, 465.
—— Duchess of (Vandyke’s), ix. 38.
—— Bill (pugilist), xii. 4, 8.
Richmond Hill, ii. 213; vi. 202; viii. 268.
Richter, Henry Jas., ix. 309.
Ridpath, George, x. 355.
Rigaud, John Francis, i. 149.
Rights of Man (Paine’s), i. 214; iii. 169; iv. 334; viii. 347; xi. 458; xii.
132.
—— of Women, The (Mary Wolstonecroft’s), vii. 234.
Rimini, Story of (Leigh Hunt’s), i. 376, 378; iv. 361; v. 378; vii. 16,
123, 381; x. 227, 407, 411.
Rinaldo (Dimond’s Conquest of Toronto), viii. 368.
Rinuccini, Countess, ix. 214.
Ritchie, David, vii. 207, 339.
—— Joseph, ix. 349.
Ritson, Joseph, ii. 79, 98, 172, 184.
Rivals, The (Sheridan’s), viii. 117, 164, 165, 508; x. 35; xi. p. vii, 307.
Rivington, John, ii. 106, 107, 108.
Road to Ruin, The (Holcroft’s), ii. 70 n., 113, 117, 121, 161, 162, 164,
193–5, 229; iv. 233; vii. 37; viii. 166.
Roadside, with figures (Gainsborough’s), xi. 203.
Rob Roy (Scott’s), iv. 245, 248; vi. 65; vii. 129; viii. 424, 425; ix. 191;
xii. 277.
Robbers, The (Schiller’s), i. 76; v. 166, 362; x. 119; xii. 158.
Robert the Devil, xii. 124.
Robert Tyke (by Emery), viii. 10, 315, 391, 416.
Robertson, Mr, x. 301.
—— —— jun., ii. 268.
Robespierre, François Maximilian Joseph Isidore, i. 390, 391 n.; ii.
187, 215, 216; iii. 110, 166, 205, 206; v. 128; vi. 102; xi. 412; xii.
189.
Robin Adair (song), vii. 304; viii. 229.
—— Hood, v. 143; viii. 424–6; xii. 18.
Robinson, George, ii. 107, 112, 116, 181, 183, 192, 194, 196, 199, 201,
225.
—— J., ii. 107, 112, 116, 205.
—— See Long, Robinson.
—— Mrs Mary, i. 378 n.; iv. 309; ix. 472; xi. 596.
—— Crusoe (Defoe’s), i. 57 n.; iv. 277; v. 13–14, 94, 156; vi. 413; vii.
164 n., 310; viii. 107 n., 167, 317, 362; ix. 171; x. 27 n., 358, 375,
379, 382; xii. 58, 366, 409.
Robson, Mr (a member of Parliament), iii. 38.
Robusti, Jacopo. See Tintoretto.
Rochelle. See La Rochelle.
Rochester (John Wilmot, Earl of), i. 157; v. 83, 106, 298 n., 372; vi.
84, 399; vii. 322; viii. 68; xi. 381.
Rock of Rubies, and Quarry of Pearls (Herrick’s), v. 312.
Rockingham, Marquis of, iii. 421; iv. 237.
Roderic (Southey’s), iv. 265.
Roderick Random (Smollett’s), i. 80; iii. 61, 218; viii. 115, 116, 117; x.
34, 35; xii. 24.
Roderigo (Shakespeare’s Othello), i. 16, 200, 207, 208; viii. 214, 217,
560.
Rodilardus, the Great Cat (Rabelais’ Pantagruel), vi. 221; viii. 471.
Rogero (in Ariosto), x. 70, 86.
Rogers, P. H., xi. 247.
—— Samuel, ii. 172; iv. 343; v. 376; vi. 222, 491; xi. 457, 536.
—— William Paul, i. 367.
Roland (in L. Bonaparte’s Charlemagne), xi. 232.
Rolando (Pulci’s), x. 69.
Rolle, John, Lord, iv. 189.
Rolls, Chapel, Sermons at (Butler’s), vii. 434 n.
Roman Poets, i. 22.
—— Wallon, The, x. 56.
Romance of the Forest (Mrs Radcliffe’s), vi. 294; vii. 222; viii. 125; x.
16, 24; xii. 64.
Romano, Julio, ix. 18, 34, 43, 226.
Romans, The Epistle to the (St Paul’s), iv. 59.
Romanzini, Miss, vii. 193.
Rome, i. 67, 79, 215; ii. 276; iii. 81, 92, 162, 178; iv. 58; v. 57; vi. 188,
280, 285, 295, 346, 352, 377, 379, 383, 384, 402, 436, 511; vii. 89,
112, 157, 177, 185, 254; ix. 69, 164, 192, 198, 199, 201 n., 207, 214,
227, 229 n., 231–2, 234, 237, 244, 249, 254, 255–6, 258, 261, 262,
265, 268, 276–7, 315, 338, 363 n., 367–8, 379, 417–9, 423, 466,
492; x. 73, 124, 189, 190, 206, 232, 277, 280, 283, 292, 296, 298,
301–3; xi. 178 n., 228, 352, 413, 422, 425, 590; xii. 170, 223, 249,
293, 386, 401, 441, 462, 463.
—— View of (Wilson’s), xi. 199.
Romeo (Shakespeare’s Romeo and Juliet), i. 153; ii. 67, 96; v. 225; vi.
273, 277, 329; viii. 199, 407, 480.
—— and Juliet (Shakespeare’s), i. 248; viii. 300;
also referred to in i. 179, 393, 394; ii. 302; v. 147; vii. 41; viii. 340,
555; ix. 214, 277; x. 64, 116; xii. 354.
Romilly, Sir Samuel, iv. 189; xi. 467, 476.
Romney, George, i. 149; vi. 342, 346, 353; ix. 424, 426; xi. 590.
—— Lord, ix. 422.
Romp, The (founded on Bickerstaffe’s Love in the City), viii. 539.
Romulus, ix. 232.
Roncesvalles (in L. Bonaparte’s Charlemagne), x. 86; xi. 232.
Roncesvalles (in Lewis’s The Monk), viii. 127.
Ronciglione (a town), ix. 231.
Ronsard, Pierre de, v. 186.
Roos, Philipp Peter. See De Tivoli, Rosa.
Rosa, Salvator, iii. 252; vi. 45; vii. 61, 157, 158, 289; viii. 125; ix. 24,
40, 51, 163, 199, 226, 231; x. 153, 276–310; xi. 203, 238, 458, 536,
543; xii. 310, 347.
—— Vito Antonio, x. 282.
Rosalind (Shakespeare’s As You Like It), viii. 74, 252, 401; xi. 367,
396; xii. 122.
Rosamond Gray (Lamb’s), iv. 366; viii. 105.
Roscius, vi. 342; viii. 174.
Roscoe, Thomas, ix. 220 n.
—— Mr (of Liverpool), vi. 514.
Roscommon (Wentworth Dillon, Earl of), v. 372.
Rose (in Farquhar’s Recruiting Officer), viii. 286.
—— (in Two Words), viii. 331.
—— Stuart, iv. 312.
—— Mr (contributor to Monthly Review), vi. 216 n.
—— Mrs, vi. 216 n.
—— Bradwardine (in Scott’s Waverley), viii. 129.
—— and Crown (an inn), ix. 298.
Rosemary Branch, The (an inn), vi. 88; vii. 70.
Rosencrantz (in Shakespeare’s Hamlet), v. 48; viii. 186, 187, 188.
Rosetta (Bickerstaffe’s Love in a Village), viii. 329, 341, 525; xi. 304,
317.
Rosina (a play), ii. 219; viii. 527.
Rosinante (Cervantes’ Don Quixote), ii. 12; iv. 338; vi. 54; vii. 300;
viii. 8, 108, 109; x. 27, 28.
Roslin Castle, ii. 316.
Rosny (a town), ix. 105.
Rossi, Carlo, x. 300, 302.
Rossini, Gioacchino, xii. 168, 384.
Rothewood (Scott’s Ivanhoe), vii. 171 n.
Rottenhammer, Johann, ix. 349.
Rotterdam, ix. 300, 301, 492.
Rouane (a town), ix. 179, 180.
Roubilliac, Louis François, vii. 89; ix. 163, 164; xi. 472.
Rouen, ix. 94, 95, 96, 97, 99, 100, 101, 119; xi. 53; xii. 57.
Rouget, Georges, ix. 123.
Roundheads, iv. 249.
Round Table (Hazlitt’s), i. 1;
also referred to in i. 370–3, 380–1, 383–4, 395; iii. 438, 447, 455,
462; v. 156, 387, 392–3; vii. 76; viii. 497, 500, 502, 521, 526; ix.
15 n., 462, 480–1, 489; x. 407; xi. 572, 576.
—— —— The, x. 21 n., 56.
Rouse, Francis, iii. 395.
Rousland Inn (Amsterdam), ix. 301.
Rousseau, Jean Jacques, i. 17, 67, 88, 105 n., 116, 136, 382–3, 427,
430; ii. 107, 166, 171 n., 308, 356, 389; iii. 170; iv. 217; v. 100, 112,
163; vi. 42, 94, 424–5, 444; vii. 32, 42, 52, 126, 224, 304, 311, 365–
7, 369, 371–2, 410 n., 429, 454 n.; viii. 29, 128; ix. 9, 29, 120, 150,
155, 161, 170, 182, 223, 282–3, 285, 288, 295, 297, 455; x. 17, 75,
291; xi. 47, 85, 134–5, 178 n., 259; xii. 37, 54, 58 n., 277, 291, 329.
—— Character of, i. 88.
Roussillon, Count of (Shakespeare’s All’s Well that Ends Well), i.
330.
Rover (in Wild Oats), viii. 392, 431.
Rovère the Conjuror, xi. p. viii.
Rovigo (a town), ix. 266.
Rowbotham, Mr (actor), viii. 464.
Rowe, John, xii. 259–60.
—— Mr (bookseller), vi. 404.
—— Nicholas, v. 268; viii. 287, 352; x. 118, 205; xi. 275, 276, 401; xii.
207.
Rowena (Scott’s Ivanhoe), viii. 426.
Rowley, William, v. 192; also referred to in v. 176, 193, 214, 224.
Roxana, or, The Fortunate Mistress (Defoe’s), x. 380, 381, 382.
Royal Academy, ix. 434;
also referred to in i. 77, 140; vi. 163, 345, 358, 359, 363, 372, 382,
389, 400, 420; viii. 168; ix. 12, 311–2, 315, 409, 421, 463, 465,
478, 482; x. 172–3, 188, 192–7, 201–2, 208, 280, 330–1; xi. 456
n., 550; xii. 196.
—— —— of Music, The (Paris), ix. 170.
—— Circus, xi. 418.
—— Cobourg, The, viii. 454.
—— Exchange, i. 9; viii. 99.
—— King and Loyal Subject (Heywood’s), v. 214.
—— Slave, The. See Oroonoko.
—— Society, The, i. 12; vi. 163, 214; viii. 58, 153.
Royston, ii. 46.
Roxburgh Club, xii. 43.
Rozinante. See Rosinante.
Rubens, Peter Paul, i. 76–8, 85, 92, 141–2, 146, 149, 151; ii. 103, 194,
231; iii. 169; v. 42, 81, 164; vi. 7, 11, 14–5, 106, 135, 172–3, 297, 317,
319–20, 333, 353, 359–61, 368, 430, 435; vii. 57, 59, 63, 95, 98,
107, 291–2, 358; viii. 141, 149, 364; ix. 13–4, 21, 29, 36, 40–1, 52–
4, 59, 71–2, 107, 110, 134, 137, 226, 299–300, 302, 311, 314, 317,
333, 386, 395, 409, 410, 427, 471–5, 489; x. 181, 192, 204; xi. 203,
212, 219, 228 n., 253, 256, 464, 519; xii. 36, 48 n., 186, 190, 197,
389.
Rudderford (a town), ii. 167.
Rudyard, Sir Benjamin, iii. 395.
Rue Mont Blanc, The, xi. 384.
—— St Honoré, The, xi. 384.
Rufus (Ben Jonson’s Sejanus), v. 263.
Rugeley (town), ii. 14, 15, 16, 17, 166.
Rule a Wife and Have a Wife (Beaumont and Fletcher), v. 262; viii.
48, 49; x. 118.
Rumford, Count (Sir Benjamin Thompson), ii. 178.
Rump Parliament, The, viii. 17.
Rundle, Mrs, vi. 416.
Runnymede, vi. 155; ix. 160.
Ruspigliosi, Palace, The, ix. 237.
—— Pavilion, The, ix. 238.
Ruspini (a doctor), ii. 183.
Russell, S. T. (actor), ii. 368; viii. 167, 317, 327, 328, 392, 400, 451,
465, 468, 469, 532; xi. 364, 368, 379, 387.
—— Lord John, vii. 257.
—— Lord William, iii. 399.
—— Square, xi. 346, 385, 386.
—— Street, ii. 59; viii. 430.
Russia, iii. 68, 71, 99, 107, 159, 295; vi. 248; ix. 130 n.; xi. 196.
Ruth (Wordsworth’s), v. 149.
—— story of (in Bible), v. 16, 183; xi. 506.
—— and Boaz (Poussin’s), ix. 109.
Ruthven (in J. R. Planche’s The Vampire), viii. 474.
Rutland Family, iv. 351.
Ruysdael, Jakob van, vi. 15; ix. 22, 35, 111, 389, 395; xi. 203, 238; xii.
202.
Rydal, Mount, v. 130.
—— Woods, View from (C. V. Fielding’s), xi. 248.
Ryder, Sir Dudley, iii. 415.
Rymer, Thomas, v. 297.
Ryswick (town), ix. 301.
S.

S—— Dr. See Stoddart, Sir John.


S—— Lord H., vi. 374.
S—— Lord R., ii. 218.
S—— Samuel, ii. 194.
Sabrina (in Milton’s Comus), viii. 231.
Sacchi, Andrea, ix. 21, 54, 240.
Sacharissa (Waller’s), v. 83; viii. 70.
Sacheverel, Dr, iii. 408; x. 374, 376.
Sachi, Madame, viii. 303.
Sackville, Thomas, v. 34, 193.
Sacraments (Poussin’s), ix. 36.
Sacred and Profane Love (Titian’s), ix. 238.
Sacripant (in Tasso), x. 71.
Sacrifice at Lystra (Raphael’s), ix. 48.
Sad One, The (Suckling’s), viii. 57.
—— Shepherd (Ben Jonson’s), v. 256; viii. 41.
Sadler’s Wells Theatre, ii. 87; vi. 79, 160; vii. 129, 240; viii. 428, 439,
454, 526; xi. 370; xii. 168, 450.
Saenredam, Pieter, ix. 20.
St Agnes (Domenichino’s), ix. 51.
—— Albans, Viscount of, vii. 28.
—— Andrews, vi. 192.
—— Ange, Mademoiselle, xi. 380.
—— Angelo, vii. 177; ix. 375.
—— Ann’s (alias Webster), xii. 34.
—— Anthony’s Day, vi. 378.
—— —— Temptation (Franks’), ix. 354.
—— Antoine, Church of Rouen, ix. 98.
—— Athanasius’s Creed, i. 48.
—— Aubin, Sir John, iii. 413.
—— Aubins, the family, xii. 269.
—— Augustin, vi. 76, 109.
—— Barbara (Ruben’s), ix. 21.
—— Bartholomew, The Massacre of, iv. 83 n.; vii. 52; xii. 461.
—— Bees, ii. 317.
—— Bernard, The Great, ix. 283, 290, 296.
—— —— (Hayter’s), xi. 245.
—— Bruno (Andrea Sacchi’s), ix. 54.
—— Catherine (Cortot’s), ix. 167.
—— —— (Parmegiano’s), ix. 51.
St Cecilia (Guercino’s), ix. 25.
—— —— (Pope’s), vi. 204 n.
—— —— (Raphael’s), ii. 288; ix. 206.
—— —— (Reynolds’s), vi. 442.
—— Cloud, vii. 449; ix. 160; xii. 459.
—— Denis, ix. 161.
—— Domingo, ii. 173, 222.
—— Dunstan’s Church, xi. 280.
—— Elmo (Godwin’s Cloudesley), x. 386.
—— Evremond, Charles Marguetel de St Denis, viii. 29, 309; xii. 37.
—— Francis, iv. 145; ix. 261.
—— George and Holy Family (Rubens’), ix. 14.
—— George’s Fields, viii. 409.
—— Germain’s, The Court of, ix. 105; x. 368.
—— Giles’s, iii. 232; iv. 44 n., 102; v. 345 n.; vi. 86, 120, 159, 414,
448, 453, 457; vii. 69; viii. 141; ix. 391; x. 356; xi. 252; xii. 132, 210,
354, 364.
—— Gingolph (a town), ix. 288, 289 et seq.
—— Giorgio Maggiore, the Church of Venice, ix. 274.
—— Gregory with Angels (Caracci’s), ix. 31.
—— —— Guillaume de, x. 53.
—— Helena, iii. 169, 246; iv. 308, 324; vii. 96; viii. 340, 530; ix. 133
n., 355.
—— Ives, iii. 396.
—— Jacques of Galicia, x. 57.
—— James’s, iii. 258; iv. 102; viii. 141; ix. 391; xi. 252.
—— —— Chronicle, The, ii. 148; vii. 228; x. 212, 213.
—— —— Palace, vi. 414; vii. 68; xi. 183, 184, 555.
—— —— Park, i. 155; ii. 109, 187; iii. 311; vii. 84; viii. 70; xi. 276.
—— —— Street, vii. 211; xii. 139, 233.
St Januarius, The Dome of, x. 294.
—— Jean, Mount, xi. 362.
—— —— de Maurienne, ix. 190.
—— Jerome (Correggio’s), vi. 399; viii. 149; ix. 107, 204, 491; xi. 197,
464; xii. 357.
—— —— (Domenichino’s), viii. 149; ix. 107, 491; xi. 197, 238.
—— —— (mosaic), ix. 235.
—— John Baptist, iii. 152; xii. 261.
—— John, Hector (Franklin, Benjamin), x. 314.
—— —— Gospel of, x. 138.
—— —— (in Leonardo da Vinci’s Last Supper), vi. 321.
—— —— in the Wilderness (Caracci’s), ix. 14; (Raphael’s), ix. 224.
—— —— (Leonardo da Vinci’s), xi. 237.
—— —— Evangelist, i. 52; v. 184.
—— —— Henry. See Bolingbroke, Viscount.
—— —— John, ii. 172, 200.
—— —— Lateran, Church of, at Rome, ix. 233.
—— —— Preaching in the Wilderness (Guido’s), ix. 26.
—— John’s College, Cambridge, v. 280.
—— —— Gate, iv. 365; x. 221.
—— —— Square, ii. 108 n.
—— Just (mountain), ix. 182.
—— Leon (Godwin’s), iv. 208; vii. 251; viii. 130, 131, 132, 420; x. 311,
386, 398, 399; xii. 67.
—— Leonard’s Crags (Scott’s Heart of Midlothian), iv. 247.
—— Lorenzo, Chapel of, at Florence, vi. 353; ix. 240.
—— Luke painting the Virgin (Raphael’s), ix. 52.
—— Luke’s (Asylum), iv. 196.
—— Mark (Tintoretto’s), ix. 274, 491; xi. 197.
—— Mark’s, Venice, ix. 274.
—— Martin’s Church, ii. 1; vii. 275.
St Martin’s Lane, ii. 90.
—— —— Street, vi. 88.
—— Maurice, ix. 284, 290.
—— Michael’s Mount (Opie’s), ii. 198.
—— Michelle, ix. 191, 240.
—— Neots (Huntingdonshire), i. 437; vi. 185.
—— Omer’s, ii. 216; ix. 302.
—— Palaye, M. de, x. 20.
—— Patrick, Landing of (Barry’s), ix. 415.
—— Paul, xii. 281.
—— —— (Raphael’s), viii. 148; ix. 48; xi. 211.
—— —— shaking off the serpent from his arm (West’s), vii. 95.
—— Paul’s Cathedral, i. 149; iii. 128; vi. 101, 358, 421; vii. 275; ix.
156, 161, 420; xi. 178 n., 232, 280, 352; xii. 58, 121, 346, 349.
—— —— Churchyard, ii. 108 n.
—— —— Epistles, vii. 223.
—— —— Head (Strand), ii. 88.
—— —— (Parma), ix. 204.
—— —— School, viii. 458, 473.
—— Peter, i. 130; iii. 265; x. 124; xi. 413; xii. 36.
—— —— Martyr, at the Louvre (Domenichino’s), vi. 15; ix. 107, 113,
206.
—— —— Martyr (Titian), i. 78, 79 n.; vi. 347; ix. 164, 270, 271, 273,
352; x. 300 n.; xi. 197, 232; xii. 48 n.
—— —— delivered from prison (Raphael’s), ix. 365.
—— Peter’s (Rome), vi. 86, 436; ix. 212, 231, 232, 233, 235, 236, 239,
241, 244, 367, 369, 376; x. 208; xi. 178 n.
—— —— The dome of, xii. 84.
—— Petersburgh, x. 392; xii. 169.
—— Pierre, Bernardin, vi. 442.
—— Preux (Rousseau), vi. 186; vii. 112, 304; ix. 281, 296; xii. 435.
—— Roche, the Church of, xii. 314.
—— Ronan’s Well (Scott), iv. 246 n.
St Sebastian (town), ix. 185.
—— —— (Titian’s), ix. 269.
—— Stephen’s Chapel, i. 105 n.; ii. 156; iii. 312; vii. 271, 273; xi. 336,
467.
—— Teresa (Domenichino’s), ix. 206.
—— Thomas’ Church (Ludgate Hill), i. 149; xii. 346.
—— Vincent, Lord, ii. 187.
Saint’s Everlasting Rest (Baxter’s), ii. 43.
Salamanca (town), iii. 113.
Saleges (town), ix. 293, 294.
Salernitano, Novelle di, ii. 172.
Salgar (in Ossian’s Songs of Selma), v. 18.
Salisbury, i. 12; vii. 223, 253; viii. 553; xi. 311 n.
—— Crag, ii. 314; ix. 336.
—— Plain, iii. 239; v. 247; vi. 188, 260, 344; ix. 55, 60; xi. 495; xii.
58.
Salle Louvois, The, ix. 174.
Sallust, v. 186, 263.
Salmasius, Claude, v. 66; vi. 176; xii. 39.
Salmon, Mrs, xi. 175, 304, 317.
Salmon’s, Mrs, Royal Waxwork, ix. 465.
Salomon (Landor’s Imaginary Conversations), x. 241.
—— Mr (picture dealer), ii. 196, 198.
Saltash (a town), iii. 408.
Saltram (a town), vi. 419.
Salutation (S. del Piombo’s), ix. 112.
—— of Elizabeth (Rembrandt’s), ix. 50.
—— of the Virgin (Titian’s), ix. 274.
Salvator Rosa. See Rosa, Salvator.
Salvator, Lady Morgan’s Life of, x. 276.
Salvatoriello, x. 282.
Sam Sharpset (Morton’s The Slave), iii. 162.
Samaritan, The Parable of the Good, vii. 461; viii. 104.
Samos, The philosopher of, iii. 151.
Samson, iii. 283; iv. 201.
—— (Caracci’s), ix. 237.
—— (Guido’s), ix. 206.
Samson and Delilah (Rubens’), ix. 21.
Samson Agonistes (Milton’s), viii. 232, 233; x. 156.
Samuel (in Kotzebue’s India in England), ii. 196.
San Giovanni de Fiorentini, The Altar of, x. 304.
—— Lorenzo (a town), ix. 230, 231.
Sanadram. See Saenredam, Pieter.
Sancho Panza (in Cervantes’ Don Quixote), i. 12, 345, 350; iii. 41,
466; iv. 36, 53; v. 113, 140; vi. 61, 184, 238; vii. 223; viii. 11, 108–
10, 151, 398; ix. 284; x. 27–30; xi. 338, 378, 409; xii. 197, 206.
Sand, Karl Ludwig. See Sandt.
Sandbach (a town), ii. 166.
Sander (a Dane), ii. 229.
Sandford, Samuel, i. 157; viii. 160.
Sandt, Karl Ludwig, xi. 321.
Sandwich, Lord, ii. 391.
Sandys, Samuel, iii. 411.
Sangreal, The, x. 21.
Sannazarius, Jacopo, i. 56.
Sans Pareil Theatre, The, viii. 394.
Sansovino (Andrea Contucci), ix. 269.
Santa Maria Maggiore, Church (at Rome), ix. 233.
Saone, The, ix. 182.
Sapio, (an actor), xi. 388.
Sapphics (Southey’s), xi. 342.
Saracens, The, x. 54.
Sarencen’s head, The, viii. 98.
Saragossa, iii. 177.
Sarah, lines to (Coleridge’s), v. 164.
Sardanapalus (Byron’s), ii. 307; iv. 258; x. 403; xi. p. viii.
Sardinia, King of, iii. 190 n.; ix. 183, 185, 288; xi. 74.
Sarratt (the chess player), vi. 195, 196 n.
Sarto, Andrea del. See Andrea.
Sastres, Mr (an Italian), ii. 182.
Satan, iii. 272.
—— (Dante’s), x. 63.
—— (Milton’s Paradise Lost), i. 38; v. 52, 53, 60, 61, 63–6, 315, 317,
371; vii. 227; viii. 561; ix. 431; x. 71, 327; xi. 254, 452, 457, 506; xii.
192, 193.
—— (Tasso’s), x. 71.
Satires (Dryden’s), v. 79, 372.
—— (Bishop Hall’s), viii. 53.
—— (Pope’s), v. 69, 76, 77, 373.
—— on the Scotch (Churchill’s), v. 119.
Satrius Secundus (in Ben Jonson’s Sejanus), v. 263.
Saturn, vii. 202, 255; x. 8.
Satyrane (Spenser’s Faëry Queen), v. 42.
Sauerweide, A, xi. 249.
Saul (Salvator’s), x. 297.
Savage, James, vi. 412.
—— Richard, vi. 411.
Saville, Sir George, iii. 424.
Savoy, ix. 185, 190, 198, 284, 292.
—— Alps, ix. 285, 295, 296.
Sawbridge, John, iii. 422.
Saxo-Grammaticus, v. 188; vii. 316.
Saxony, iii. 104, 158, 216.
—— King of, iii. 106.
Say, Jean Baptiste, ii. 415.
Sayings and Doings (Theodore Hook’s), vi. 418; ix. 186; xi. 346–9,
385.
Says, The (Philosophers), ii. 415; xii. 255.
Scalds, The, x. 9.
Scaliger, Joseph Justus, vi. 76.
Scapethrift (in Still’s Gammer Gurton’s Needle), v. 286.
Scarborough, ii. 79, 310.
Scarlett, James. See Abinger, Lord.
Scarron, Paul, vi. 419.
Scattergood (in Cooke’s Greene’s Tu Quoque), v. 290.
Sceptic, The (Holcroft’s), ii. 104.
Sceptical Solution of Sceptical Doubts (Hume’s), xi. 516.
Sceva (in Beaumont and Fletcher’s False One), v. 253.
Schappe Kaspar, vi. 76.
Schedoni (Mrs Radcliffe’s Castle of Udolpho), viii. 126.
Schelling, F. W. J., iv. 218; x. 141, 145.
Schiavone, ix. 226.
Schill, Ode on (Wordsworth’s), xi. 414.
Schiller, Johann Christoph Friedrich, i. 76; ii. 229; iv. 219; v. 362; vi.
11 n., 325 n.; vii. 226, 313, 328–9; viii. 391; x. 119; xii. 67.
Schiller, Sonnet to (Coleridge’s), v. 166.
Schlegel, A. W. von., i. 171–2, 239, 253, 270, 346, 353, 356; v. 207;
vii. 122; viii. 39, 284, 324, 491; x. 46, 78, 79, 145, 186; xi. 598.
—— on the Drama, x. 78.
Scholars, The Shyness of, xii. 68.
School for Arrogance (Holcroft’s), ii. 116, 117, 121, 201.
—— of Athens (Raphael’s), ix. 240, 365, 380.
—— for Gallantry (Jones’s), xi. 376.
—— with Girls at Work (Crespi’s), ix. 20.
—— for Ingratitude (Fisher’s), ii. 201.
—— of Reform, The (Morton’s), viii. 315.
—— for Scandal, The (Sheridan’s), viii. 250;
also referred to in vi. 206; viii. 164–5, 415, 508; ix. 150; xi. 392; xii.
24, 138.
—— for Women (Molière’s). See École.
Schoolmaster, The (Titian’s), i. 76.
Schoolmen, vi. 107; vii. 182 n., 316, 317.
School-Mistress (Shenstone’s), v. 119, 375.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like